WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
modified patch
bugzilla_20120304.patch (text/plain), 7.07 KB, created by
Hyowon Kim
on 2012-03-04 00:59:50 PST
(
hide
)
Description:
modified patch
Filename:
MIME Type:
Creator:
Hyowon Kim
Created:
2012-03-04 00:59:50 PST
Size:
7.07 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5f10759..792a478 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2012-03-04 Hyowon Kim <hw1008.kim@samsung.com> >+ >+ [EFL] Evas_GL initialization and destruction in GraphicsContext3DPrivate >+ https://bugs.webkit.org/show_bug.cgi?id=80211 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch adds initialization and destruction codes using Evas_GL APIs to GC3DPrivate. >+ >+ No new tests. No behavior change. >+ >+ * platform/graphics/efl/GraphicsContext3DPrivate.cpp: >+ (WebCore::GraphicsContext3DPrivate::create): >+ (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): >+ (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate): >+ (WebCore::GraphicsContext3DPrivate::initialize): >+ (WebCore::GraphicsContext3DPrivate::createSurface): >+ (WebCore::GraphicsContext3DPrivate::makeContextCurrent): >+ * platform/graphics/efl/GraphicsContext3DPrivate.h: >+ (GraphicsContext3DPrivate): >+ > 2012-03-02 Pablo Flouret <pablof@motorola.com> > > Editor's default paragraph separator is not reset when a frame's document is changed >diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp >index e1003d9..08153f0 100644 >--- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp >+++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp >@@ -32,11 +32,11 @@ > > namespace WebCore { > >-PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool renderDirectlyToEvasGLObject) >+PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool renderDirectlyToHostWindow) > { > OwnPtr<GraphicsContext3DPrivate> internal = adoptPtr(new GraphicsContext3DPrivate()); > >- if (!internal->initialize(attributes, hostWindow, renderDirectlyToEvasGLObject)) >+ if (!internal->initialize(attributes, hostWindow, renderDirectlyToHostWindow)) > return nullptr; > > return internal.release(); >@@ -49,25 +49,101 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate() > , m_evasGL(0) > , m_context(0) > , m_surface(0) >- , m_config(0) > , m_api(0) > { > } > > GraphicsContext3DPrivate::~GraphicsContext3DPrivate() > { >+ if (!m_evasGL) >+ return; >+ >+ if (m_surface) >+ evas_gl_surface_destroy(m_evasGL, m_surface); >+ >+ if (m_context) >+ evas_gl_context_destroy(m_evasGL, m_context); >+ >+ evas_gl_free(m_evasGL); > } > >-bool GraphicsContext3DPrivate::initialize(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool bRenderDirectlyToEvasGLObject) >+bool GraphicsContext3DPrivate::initialize(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool renderDirectlyToHostWindow) > { >- notImplemented(); >- return false; >+ PageClientEfl* pageClient = static_cast<PageClientEfl*>(hostWindow->platformPageClient()); >+ >+ Evas* evas = evas_object_evas_get(pageClient->view()); >+ >+ // Create a new Evas_GL object for gl rendering on efl. >+ m_evasGL = evas_gl_new(evas); >+ if (!m_evasGL) >+ return false; >+ >+ // Get the API for rendering using OpenGL. >+ // This returns a structure that contains all the OpenGL functions we can use to render in Evas >+ m_api = evas_gl_api_get(m_evasGL); >+ if (!m_api) >+ return false; >+ >+ Evas_GL_Context* shareContext = 0; >+ >+#if USE(ACCELERATED_COMPOSITING) >+ // GC3D with RenderOffscreen style for WebGL has to be shared with AC's context when AC is enabled. >+ if (!renderDirectlyToHostWindow) { >+ GraphicsContext3D* context = pageClient->acceleratedCompositingContext(); >+ if (context) >+ shareContext = static_cast<Evas_GL_Context*>(context->platformGraphicsContext3D()); >+ } >+#endif >+ >+ // Create a context >+ m_context = evas_gl_context_create(m_evasGL, shareContext); >+ if (!m_context) >+ return false; >+ >+ // Create a surface >+ if (!createSurface(pageClient, renderDirectlyToHostWindow)) >+ return false; >+ >+ return makeContextCurrent(); > } > >-bool GraphicsContext3DPrivate::createSurface(PageClientEfl* pageClient, bool renderDirectlyToEvasGLObject) >+bool GraphicsContext3DPrivate::createSurface(PageClientEfl* pageClient, bool renderDirectlyToHostWindow) > { >- notImplemented(); >- return false; >+ // If RenderStyle is RenderOffscreen, we will be rendering to a FBO, >+ // so Evas_GL_Surface has a 1x1 dummy surface. >+ int x = 0; >+ int y = 0; >+ int width = 1; >+ int height = 1; >+ >+ // But, in case of RenderDirectlyToHostWindow, we have to render to a render target surface with the same size as our webView. >+ if (renderDirectlyToHostWindow) >+ evas_object_geometry_get(pageClient->view(), &x, &y, &width, &height); >+ >+ Evas_GL_Config config = { >+ EVAS_GL_RGBA_8888, >+ EVAS_GL_DEPTH_BIT_8, >+ EVAS_GL_STENCIL_NONE, // FIXME: set EVAS_GL_STENCIL_BIT_8 after fixing Evas_GL bug. >+ EVAS_GL_OPTIONS_NONE >+ }; >+ >+ // Create a new Evas_GL_Surface object >+ m_surface = evas_gl_surface_create(m_evasGL, &config, width, height); >+ if (!m_surface) >+ return false; >+ >+#if USE(ACCELERATED_COMPOSITING) >+ if (renderDirectlyToHostWindow) { >+ Evas_Native_Surface nativeSurface; >+ // Fill in the Native Surface information from the given Evas GL surface. >+ evas_gl_native_surface_get(m_evasGL, m_surface, &nativeSurface); >+ >+ // Create and specially set up a evas_object which act as the render targer surface. >+ if (!pageClient->createEvasObjectForAcceleratedCompositing(&nativeSurface, x, y, width, height)) >+ return false; >+ } >+#endif >+ return true; > } > > PlatformGraphicsContext3D GraphicsContext3DPrivate::platformGraphicsContext3D() const >@@ -77,8 +153,7 @@ PlatformGraphicsContext3D GraphicsContext3DPrivate::platformGraphicsContext3D() > > bool GraphicsContext3DPrivate::makeContextCurrent() > { >- notImplemented(); >- return false; >+ return evas_gl_make_current(m_evasGL, m_surface, m_context); > } > > bool GraphicsContext3DPrivate::isGLES2Compliant() const >diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h >index 676438b..d02b878 100644 >--- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h >+++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h >@@ -204,7 +204,7 @@ public: > private: > GraphicsContext3DPrivate(); > >- bool initialize(GraphicsContext3D::Attributes attrs, HostWindow*, bool renderDirectlyToEvasGLObject); >+ bool initialize(GraphicsContext3D::Attributes attrs, HostWindow*, bool renderDirectlyToHostWindow); > > bool createSurface(PageClientEfl*, bool renderDirectlyToEvasGLObject); > >@@ -219,7 +219,6 @@ private: > Evas_GL* m_evasGL; > Evas_GL_Context* m_context; > Evas_GL_Surface* m_surface; >- Evas_GL_Config* m_config; > Evas_GL_API* m_api; > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 80211
:
129998
|
129999
| 130018