Changeset 135468 in webkit
- Timestamp:
- Nov 21, 2012 8:11:34 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r135465 r135468 1 2012-11-21 Kondapally Kalyan <kalyan.kondapally@intel.com> 2 3 [EFL] Refactor GraphicsContext3DEFL. 4 https://bugs.webkit.org/show_bug.cgi?id=101291. 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 GraphicsContext3DEfl creates GraphicsContext3DPrivate, which acts as its platform Layer. 9 GraphicsContext3DPrivate needs to handle the following cases: 10 1) To provide an off-screen buffer for accelerated composition. 11 2) Render to a current context. 12 3) To render directly to host window. (currently not supported.) 13 14 Before this patch Evas was used to provide us an off-screen context and buffer. GLX was used in 15 the other supported case. Evas acts as a glue layer to provide us with appropriate 16 GL bindings (OpenGL functions), GL context and drawable (surface/offscreenbuffer). 17 However, primitive rendering is handled by TextureMapper and OpenGLShims is used to load the needed GL functions. 18 19 It would be for our advantage to be able to take in to use any optimisations/extensions 20 provided by underlying drivers, specific to a platform (e.g. GLX_MESA_copy_sub_buffer etc.). 21 This patch introduces an abstraction layer to make it easy to add support for any GL backend (GLX, EGL etc.) 22 and do any platform specific optimizations as needed without complicating GraphicsContext3DPrivate class. 23 Two new classes are added with this implementation, GLPlatformContext and GLPlatformSurface. 24 GraphicsContext3DPrivate would create and own a GLPlatformContext and GLPlatformSurface. 25 26 GLPlatformContext encapsulates an OpenGL context hiding any platform specific management. 27 It uses GL extension ARB_robustness (when available) to detect driver resets. 28 It defines a simple interface for things that need to be handled by the context. Support 29 for multi-threaded usage and shared context-group would be added later. 30 31 GLPlatformSurface encapsulates an OpenGL drawable hiding any platform specific management. 32 It defines a simple interface for things that need to be handled by the surface. 33 It creates an off-screen rendering area. Any GLPlatformContext (compatible with the surface) 34 can be used to render into this off-screen area. 35 36 This patch also adds GLX implementation. To keep the patch to minimum EGL support would be added in another changeset. 37 38 * PlatformEfl.cmake: 39 * platform/graphics/efl/GraphicsContext3DEfl.cpp: 40 (WebCore::GraphicsContext3D::create): 41 (WebCore::GraphicsContext3D::GraphicsContext3D): 42 (WebCore::GraphicsContext3D::~GraphicsContext3D): 43 (WebCore::GraphicsContext3D::makeContextCurrent): 44 (WebCore::GraphicsContext3D::setContextLostCallback): 45 * platform/graphics/efl/GraphicsContext3DPrivate.cpp: 46 (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): 47 (GraphicsContext3DPrivate::~GraphicsContext3DPrivate): 48 (GraphicsContext3DPrivate::releaseResources): 49 (GraphicsContext3DPrivate::setContextLostCallback): 50 (GraphicsContext3DPrivate::platformGraphicsContext3D): 51 (GraphicsContext3DPrivate::makeContextCurrent): 52 (GraphicsContext3DPrivate::createGraphicsSurfaces): 53 (GraphicsContext3DPrivate::copyToGraphicsSurface): 54 (GraphicsContext3DPrivate::graphicsSurfaceToken): 55 * platform/graphics/efl/GraphicsContext3DPrivate.h: 56 (GraphicsContext3DPrivate): 57 * platform/graphics/opengl/GLDefs.h: Added. 58 (WebCore): 59 * platform/graphics/opengl/GLPlatformContext.cpp: Added. 60 (WebCore): 61 (WebCore::GLPlatformContext::createContext): 62 (WebCore::GLPlatformContext::createOffScreenContext): 63 (WebCore::GLPlatformContext::createCurrentContextWrapper): 64 (WebCore::GLPlatformContext::GLPlatformContext): 65 (WebCore::GLPlatformContext::~GLPlatformContext): 66 (WebCore::GLPlatformContext::makeCurrent): 67 (WebCore::GLPlatformContext::isValid): 68 (WebCore::GLPlatformContext::releaseCurrent): 69 (WebCore::GLPlatformContext::handle): 70 (WebCore::GLPlatformContext::isCurrentContext): 71 (WebCore::GLPlatformContext::initialize): 72 (WebCore::GLPlatformContext::getCurrent): 73 (WebCore::GLPlatformContext::platformMakeCurrent): 74 (WebCore::GLPlatformContext::platformReleaseCurrent): 75 (WebCore::GLPlatformContext::destroy): 76 * platform/graphics/opengl/GLPlatformContext.h: Added. 77 (WebCore): 78 (GLPlatformContext): 79 * platform/graphics/opengl/GLPlatformSurface.cpp: Added. 80 (WebCore): 81 (WebCore::GLPlatformSurface::createOffscreenSurface): 82 (WebCore::GLPlatformSurface::createTransportSurface): 83 (WebCore::GLPlatformSurface::GLPlatformSurface): 84 (WebCore::GLPlatformSurface::~GLPlatformSurface): 85 (WebCore::GLPlatformSurface::handle): 86 (WebCore::GLPlatformSurface::geometry): 87 (WebCore::GLPlatformSurface::sharedDisplay): 88 (WebCore::GLPlatformSurface::configuration): 89 (WebCore::GLPlatformSurface::swapBuffers): 90 (WebCore::GLPlatformSurface::copyTexture): 91 (WebCore::GLPlatformSurface::updateContents): 92 (WebCore::GLPlatformSurface::setGeometry): 93 (WebCore::GLPlatformSurface::destroy): 94 * platform/graphics/opengl/GLPlatformSurface.h: Added. 95 (WebCore): 96 (GLPlatformSurface): 97 GLXOffScreenContext creates an off-screen context. This is used when 98 renderstyle is RenderOffscreen. 99 It uses GL extension GLX_ARB_create_context (when available) 100 to create a context else falls back to use glXCreateNewContext. 101 * platform/graphics/surfaces/glx/GLXContext.cpp: Added. 102 (WebCore): 103 (WebCore::initializeARBExtensions): 104 (WebCore::GLXOffScreenContext::GLXOffScreenContext): 105 (WebCore::GLXOffScreenContext::initialize): 106 (WebCore::GLXOffScreenContext::~GLXOffScreenContext): 107 (WebCore::GLXOffScreenContext::isCurrentContext): 108 (WebCore::GLXOffScreenContext::platformMakeCurrent): 109 (WebCore::GLXOffScreenContext::platformReleaseCurrent): 110 (WebCore::GLXOffScreenContext::freeResources): 111 (WebCore::GLXOffScreenContext::destroy): 112 GLXCurrentContextWrapper acts as a wrapper for current context. 113 This is used when renderstyle is RenderToCurrentGLContext. 114 * platform/graphics/surfaces/glx/GLXContext.h: Added. 115 (WebCore): 116 (GLXCurrentContextWrapper): 117 (WebCore::GLXCurrentContextWrapper::GLXCurrentContextWrapper): 118 (WebCore::GLXCurrentContextWrapper::~GLXCurrentContextWrapper): 119 (GLXOffScreenContext): 120 * platform/graphics/surfaces/glx/GLXSurface.cpp: Added. 121 (WebCore): 122 (WebCore::GLXSurface::GLXSurface): 123 (WebCore::GLXSurface::~GLXSurface): 124 (WebCore::GLXSurface::visualInfo): 125 (WebCore::GLXSurface::xWindow): 126 (WebCore::GLXSurface::pBufferConfiguration): 127 (WebCore::GLXSurface::transportSurfaceConfiguration): 128 (WebCore::GLXSurface::isXRenderExtensionSupported): 129 GLXTransportSurface creates Window and uses it as an off-screen surface. 130 Any GLContext that was created with respect to configuration can be used 131 to render into this. 132 This is used when contents of the buffer are to be provided to UI Process 133 for display. 134 (WebCore::GLXTransportSurface::GLXTransportSurface): 135 (WebCore::GLXTransportSurface::~GLXTransportSurface): 136 (WebCore::GLXTransportSurface::configuration): 137 (WebCore::GLXTransportSurface::swapBuffers): 138 (WebCore::GLXTransportSurface::setGeometry): 139 (WebCore::GLXTransportSurface::initialize): 140 (WebCore::GLXTransportSurface::destroy): 141 (WebCore::GLXTransportSurface::freeResources): 142 GLXPBuffer, Creates a GL surface (PBuffer) used for offscreen rendering. 143 Any GLContext that was created with respect to configuration can be used 144 to render into this. 145 (WebCore::GLXPBuffer::GLXPBuffer): 146 (WebCore::GLXPBuffer::~GLXPBuffer): 147 (WebCore::GLXPBuffer::initialize): 148 (WebCore::GLXPBuffer::configuration): 149 (WebCore::GLXPBuffer::destroy): 150 (WebCore::GLXPBuffer::freeResources): 151 * platform/graphics/surfaces/glx/GLXSurface.h: Added. 152 (WebCore): 153 Creates X resources which are shared between surface and context. 154 (SharedX11Resources): 155 (WebCore::SharedX11Resources::create): 156 (WebCore::SharedX11Resources::deref): 157 (WebCore::SharedX11Resources::getXWindow): 158 (WebCore::SharedX11Resources::display): 159 (WebCore::SharedX11Resources::visualInfo): 160 (WebCore::SharedX11Resources::createConfig): 161 (WebCore::SharedX11Resources::pBufferContextConfig): 162 (WebCore::SharedX11Resources::surfaceContextConfig): 163 (WebCore::SharedX11Resources::isXRenderExtensionSupported): 164 (WebCore::SharedX11Resources::SharedX11Resources): 165 (WebCore::SharedX11Resources::~SharedX11Resources): 166 (GLXSurface): 167 (GLXTransportSurface): 168 (GLXPBuffer): 169 1 170 2012-11-21 Andreas Kling <akling@apple.com> 2 171 -
trunk/Source/WebCore/PlatformEfl.cmake
r135100 r135468 260 260 "${WEBCORE_DIR}/platform/graphics/opengl" 261 261 "${WEBCORE_DIR}/platform/graphics/surfaces" 262 "${WEBCORE_DIR}/platform/graphics/surfaces/glx" 262 263 "${WEBCORE_DIR}/platform/graphics/texmap" 263 264 ) … … 269 270 platform/graphics/opengl/Extensions3DOpenGL.cpp 270 271 platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 272 platform/graphics/opengl/GLPlatformContext.cpp 273 platform/graphics/opengl/GLPlatformSurface.cpp 271 274 platform/graphics/opengl/GraphicsContext3DOpenGL.cpp 272 275 platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp 273 276 platform/graphics/surfaces/GraphicsSurface.cpp 277 platform/graphics/surfaces/glx/GLXSurface.cpp 278 platform/graphics/surfaces/glx/GLXContext.cpp 274 279 platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp 275 280 platform/graphics/texmap/TextureMapperGL.cpp -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
r135083 r135468 1 1 /* 2 2 Copyright (C) 2012 Samsung Electronics 3 Copyright (C) 2012 Intel Corporation. 3 4 4 5 This library is free software; you can redistribute it and/or … … 28 29 #include "OpenGLShims.h" 29 30 #include "PlatformContextCairo.h" 30 #include <GL/glx.h>31 31 32 32 #if USE(OPENGL_ES_2) … … 40 40 PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, RenderStyle renderStyle) 41 41 { 42 if (renderStyle == RenderDirectlyToHostWindow) 43 return 0; 44 42 45 RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle)); 43 46 return context->m_private ? context.release() : 0; … … 68 71 , m_private(adoptPtr(new GraphicsContext3DPrivate(this, hostWindow, renderStyle))) 69 72 { 73 if (!m_private || !m_private->m_platformContext) { 74 m_private = nullptr; 75 return; 76 } 77 70 78 validateAttributes(); 71 72 if (!m_private)73 return;74 75 static bool initializedShims = false;76 static bool success = true;77 if (!initializedShims) {78 success = initializeOpenGLShims();79 initializedShims = true;80 }81 if (!success) {82 m_private = nullptr;83 return;84 }85 86 if (renderStyle == RenderToCurrentGLContext) {87 // Evas doesn't allow including gl headers and Evas_GL headers at the same time,88 // so we need to query the current gl context/surface here instead of in GraphicsContext3DPrivate.89 void* currentContext = (void*)glXGetCurrentContext();90 void* currentSurface = (void*)glXGetCurrentDrawable();91 m_private->setCurrentGLContext(currentContext, currentSurface);92 }93 79 94 80 if (renderStyle == RenderOffscreen) { … … 148 134 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); 149 135 #endif 136 glClearColor(0.0, 0.0, 0.0, 0.0); 150 137 } 151 138 152 139 GraphicsContext3D::~GraphicsContext3D() 153 140 { 154 if (m_renderStyle == RenderToCurrentGLContext || !m_private) 155 return; 156 157 makeContextCurrent(); 141 if (!m_private || !makeContextCurrent()) 142 return; 143 144 if (!m_fbo) { 145 m_private->releaseResources(); 146 return; 147 } 148 158 149 glDeleteTextures(1, &m_texture); 159 150 … … 166 157 glDeleteFramebuffers(1, &m_multisampleFBO); 167 158 } else if (m_attrs.stencil || m_attrs.depth) { 168 169 159 #if USE(OPENGL_ES_2) 170 160 if (m_attrs.depth) … … 176 166 glDeleteRenderbuffers(1, &m_depthStencilBuffer); 177 167 } 168 178 169 glDeleteFramebuffers(1, &m_fbo); 170 m_private->releaseResources(); 179 171 } 180 172 … … 198 190 bool GraphicsContext3D::makeContextCurrent() 199 191 { 200 if (!m_private)201 return false;202 203 if (m_renderStyle == RenderToCurrentGLContext)204 return true;205 206 192 return m_private->makeContextCurrent(); 207 193 } … … 216 202 } 217 203 218 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback> )219 { 220 notImplemented();204 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback> callBack) 205 { 206 m_private->setContextLostCallback(callBack); 221 207 } 222 208 -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
r135083 r135468 1 1 /* 2 2 Copyright (C) 2012 Samsung Electronics 3 Copyright (C) 2012 Intel Corporation. 3 4 4 5 This library is free software; you can redistribute it and/or … … 19 20 20 21 #include "config.h" 22 #include "GraphicsContext3DPrivate.h" 21 23 22 24 #if USE(3D_GRAPHICS) || USE(ACCELERATED_COMPOSITING) 23 #include "GraphicsContext3DPrivate.h"24 25 25 #include "GraphicsContext.h"26 26 #include "HostWindow.h" 27 27 #include "NotImplemented.h" 28 28 #include "PlatformContextCairo.h" 29 #include <Ecore_Evas.h> 30 #include <Evas_GL.h> 31 #include <wtf/OwnArrayPtr.h> 32 #include <wtf/text/CString.h> 29 30 #if USE(OPENGL_ES_2) 31 #include <GLES2/gl2.h> 32 #include <GLES2/gl2ext.h> 33 #else 34 #include "OpenGLShims.h" 35 #endif 33 36 34 37 namespace WebCore { … … 37 40 : m_context(context) 38 41 , m_hostWindow(hostWindow) 39 , m_evasGL(0) 40 , m_evasGLContext(0) 41 , m_evasGLSurface(0) 42 , m_glContext(0) 43 , m_glSurface(0) 44 , m_api(0) 45 , m_renderStyle(renderStyle) 42 , m_pendingSurfaceResize(false) 46 43 { 47 if (renderStyle == GraphicsContext3D::RenderToCurrentGLContext)48 return;49 50 44 if (m_hostWindow && m_hostWindow->platformPageClient()) { 51 45 // FIXME: Implement this code path for WebKit1. … … 54 48 } 55 49 56 // For WebKit2, we need to create a dummy ecoreEvas object for the WebProcess in order to use EvasGL APIs. 57 #ifdef HAVE_ECORE_X 58 ecore_evas_init(); 59 m_ecoreEvas = adoptPtr(ecore_evas_gl_x11_new(0, 0, 0, 0, 1, 1)); 60 if (!m_ecoreEvas) 61 return; 62 #else 63 return; 64 #endif 65 66 Evas* evas = ecore_evas_get(m_ecoreEvas.get()); 67 if (!evas) 50 m_platformContext = GLPlatformContext::createContext(renderStyle); 51 if (!m_platformContext) 68 52 return; 69 53 70 // Create a new Evas_GL object for gl rendering on efl. 71 m_evasGL = evas_gl_new(evas); 72 if (!m_evasGL) 73 return; 54 if (renderStyle == GraphicsContext3D::RenderOffscreen) { 55 #if USE(GRAPHICS_SURFACE) 56 m_platformSurface = GLPlatformSurface::createTransportSurface(); 57 #else 58 m_platformSurface = GLPlatformSurface::createOffscreenSurface(); 59 #endif 60 if (!m_platformSurface) { 61 m_platformContext = nullptr; 62 return; 63 } 74 64 75 // Get the API for rendering using OpenGL. 76 // This returns a structure that contains all the OpenGL functions we can use to render in Evas 77 m_api = evas_gl_api_get(m_evasGL); 78 if (!m_api) 79 return; 80 81 // Create a context 82 m_evasGLContext = evas_gl_context_create(m_evasGL, 0); 83 if (!m_evasGLContext) 84 return; 85 86 // Create a surface 87 if (!createSurface(0, renderStyle == GraphicsContext3D::RenderDirectlyToHostWindow)) 88 return; 89 90 makeContextCurrent(); 91 65 if (!m_platformContext->initialize(m_platformSurface.get()) || !m_platformContext->makeCurrent(m_platformSurface.get())) { 66 releaseResources(); 67 m_platformContext = nullptr; 68 m_platformSurface = nullptr; 92 69 #if USE(GRAPHICS_SURFACE) 93 IntSize surfaceSize(m_context->m_currentWidth, m_context->m_currentHeight);94 m_surfaceFlags = GraphicsSurface::SupportsTextureTarget | GraphicsSurface::SupportsSharing;95 if (!surfaceSize.isEmpty()) 96 m_graphicsSurface = GraphicsSurface::create(surfaceSize, m_surfaceFlags);70 } else 71 m_surfaceHandle = GraphicsSurfaceToken(m_platformSurface->handle()); 72 #else 73 } 97 74 #endif 75 } 98 76 } 99 77 100 78 GraphicsContext3DPrivate::~GraphicsContext3DPrivate() 101 79 { 102 if (!m_evasGL)103 return;104 105 if (m_evasGLSurface)106 evas_gl_surface_destroy(m_evasGL, m_evasGLSurface);107 108 if (m_evasGLContext)109 evas_gl_context_destroy(m_evasGL, m_evasGLContext);110 111 evas_gl_free(m_evasGL);112 113 #if USE(GRAPHICS_SURFACE)114 m_graphicsSurface.clear();115 #endif116 80 } 117 81 118 bool GraphicsContext3DPrivate::createSurface(PageClientEfl* pageClient, bool renderDirectlyToHostWindow)82 void GraphicsContext3DPrivate::releaseResources() 119 83 { 120 // If RenderStyle is RenderOffscreen, we will be rendering to a FBO, 121 // so Evas_GL_Surface has a 1x1 dummy surface. 122 int width = 1; 123 int height = 1; 84 // Release the current context and drawable only after destroying any associated gl resources. 85 if (m_platformContext) 86 m_platformContext->destroy(); 124 87 125 // But, in case of RenderDirectlyToHostWindow, we have to render to a render target surface with the same size as our webView. 126 if (renderDirectlyToHostWindow) { 127 if (!pageClient) 128 return false; 129 // FIXME: Get geometry of webView and set size of target surface. 130 } 88 if (m_platformSurface) 89 m_platformSurface->destroy(); 131 90 132 Evas_GL_Config config = { 133 EVAS_GL_RGBA_8888, 134 EVAS_GL_DEPTH_BIT_8, 135 EVAS_GL_STENCIL_NONE, // FIXME: set EVAS_GL_STENCIL_BIT_8 after fixing Evas_GL bug. 136 EVAS_GL_OPTIONS_NONE, 137 EVAS_GL_MULTISAMPLE_NONE 138 }; 139 140 // Create a new Evas_GL_Surface object 141 m_evasGLSurface = evas_gl_surface_create(m_evasGL, &config, width, height); 142 if (!m_evasGLSurface) 143 return false; 144 145 #if USE(ACCELERATED_COMPOSITING) 146 if (renderDirectlyToHostWindow) { 147 Evas_Native_Surface nativeSurface; 148 // Fill in the Native Surface information from the given Evas GL surface. 149 evas_gl_native_surface_get(m_evasGL, m_evasGLSurface, &nativeSurface); 150 151 // FIXME: Create and specially set up a evas_object which act as the render targer surface. 152 } 153 #endif 154 155 return true; 91 if (m_platformContext) 92 m_platformContext->releaseCurrent(); 156 93 } 157 94 158 void GraphicsContext3DPrivate::setCurrentGLContext(void* context, void* surface)95 bool GraphicsContext3DPrivate::createSurface(PageClientEfl*, bool) 159 96 { 160 m_glContext = context; 161 m_glSurface = surface; 97 notImplemented(); 98 return false; 99 } 100 101 void GraphicsContext3DPrivate::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callBack) 102 { 103 m_contextLostCallback = callBack; 162 104 } 163 105 164 106 PlatformGraphicsContext3D GraphicsContext3DPrivate::platformGraphicsContext3D() const 165 107 { 166 if (m_renderStyle == GraphicsContext3D::RenderToCurrentGLContext) 167 return m_glContext; 168 169 return m_evasGLContext; 108 return m_platformContext->handle(); 170 109 } 171 110 172 111 bool GraphicsContext3DPrivate::makeContextCurrent() 173 112 { 174 return evas_gl_make_current(m_evasGL, m_evasGLSurface, m_evasGLContext); 113 bool success = m_platformContext->makeCurrent(m_platformSurface.get()); 114 115 if (!m_platformContext->isValid()) { 116 // FIXME: Restore context 117 if (m_contextLostCallback) 118 m_contextLostCallback->onContextLost(); 119 120 success = false; 121 } 122 123 return success; 175 124 } 176 125 … … 183 132 184 133 #if USE(GRAPHICS_SURFACE) 185 void GraphicsContext3DPrivate::createGraphicsSurfaces(const IntSize& size)134 void GraphicsContext3DPrivate::createGraphicsSurfaces(const IntSize&) 186 135 { 187 if (size.isEmpty()) 188 m_graphicsSurface.clear(); 189 else 190 m_graphicsSurface = GraphicsSurface::create(size, m_surfaceFlags); 136 m_pendingSurfaceResize = true; 191 137 } 192 138 193 139 uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface() 194 140 { 195 if (!m_ graphicsSurface)141 if (!m_platformContext || !makeContextCurrent()) 196 142 return 0; 197 143 198 makeContextCurrent(); 199 m_graphicsSurface->copyFromTexture(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight)); 200 return m_graphicsSurface->swapBuffers(); 144 if (m_pendingSurfaceResize) { 145 m_pendingSurfaceResize = false; 146 m_platformSurface->setGeometry(IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight)); 147 } 148 149 if (m_context->m_attrs.antialias) { 150 #if !USE(OPENGL_ES_2) 151 glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_context->m_multisampleFBO); 152 glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_context->m_fbo); 153 glBlitFramebuffer(0, 0, m_context->m_currentWidth, m_context->m_currentHeight, 0, 0, m_context->m_currentWidth, m_context->m_currentHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR); 154 #endif 155 } 156 157 m_platformSurface->updateContents(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight), m_context->m_boundFBO); 158 return 0; 201 159 } 202 160 203 161 GraphicsSurfaceToken GraphicsContext3DPrivate::graphicsSurfaceToken() const 204 162 { 205 return m_ graphicsSurface->exportToken();163 return m_surfaceHandle; 206 164 } 207 165 #endif -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h
r135083 r135468 1 1 /* 2 2 Copyright (C) 2012 Samsung Electronics 3 Copyright (C) 2012 Intel Corporation. 3 4 4 5 This library is free software; you can redistribute it and/or … … 21 22 #define GraphicsContext3DPrivate_h 22 23 24 #if USE(3D_GRAPHICS) || USE(ACCELERATED_COMPOSITING) 25 23 26 #include "GraphicsContext3D.h" 24 27 … … 27 30 #endif 28 31 29 #if USE(GRAPHICS_SURFACE) 30 #include "GraphicsSurface.h" 31 #endif 32 33 typedef struct _Evas_GL Evas_GL; 34 typedef struct _Evas_GL_Surface Evas_GL_Surface; 35 typedef struct _Evas_GL_Context Evas_GL_Context; 36 typedef struct _Evas_GL_Config Evas_GL_Config; 37 typedef struct _Evas_GL_API Evas_GL_API; 32 #include "GLPlatformContext.h" 33 #include <wtf/PassOwnPtr.h> 38 34 39 35 class PageClientEfl; … … 49 45 ~GraphicsContext3DPrivate(); 50 46 47 bool createSurface(PageClientEfl*, bool); 51 48 PlatformGraphicsContext3D platformGraphicsContext3D() const; 52 49 void setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callBack); 53 50 #if USE(ACCELERATED_COMPOSITING) 54 51 PlatformLayer* platformLayer() const; … … 62 59 void createGraphicsSurfaces(const IntSize&); 63 60 #endif 64 65 61 bool makeContextCurrent(); 66 bool createSurface(PageClientEfl*, bool renderDirectlyToEvasGLObject); 67 void setCurrentGLContext(void*, void*); 68 62 void releaseResources(); 69 63 GraphicsContext3D::Attributes m_attributes; 70 64 GraphicsContext3D* m_context; 71 65 HostWindow* m_hostWindow; 66 OwnPtr<GLPlatformContext> m_platformContext; 67 OwnPtr<GLPlatformSurface> m_platformSurface; 72 68 #if USE(GRAPHICS_SURFACE) 73 GraphicsSurface::Flags m_surfaceFlags; 74 RefPtr<GraphicsSurface> m_graphicsSurface; 69 GraphicsSurfaceToken m_surfaceHandle; 75 70 #endif 76 71 OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback; 77 72 ListHashSet<GC3Denum> m_syntheticErrors; 78 79 OwnPtr<Ecore_Evas> m_ecoreEvas; 80 Evas_GL* m_evasGL; 81 Evas_GL_Context* m_evasGLContext; 82 Evas_GL_Surface* m_evasGLSurface; 83 void* m_glContext; 84 void* m_glSurface; 85 Evas_GL_API* m_api; 86 GraphicsContext3D::RenderStyle m_renderStyle; 73 bool m_pendingSurfaceResize; 87 74 }; 88 75 89 76 } // namespace WebCore 90 77 91 #endif // GraphicsLayerEfl_h 78 #endif 79 80 #endif
Note: See TracChangeset
for help on using the changeset viewer.