Changeset 109609 in webkit
- Timestamp:
- Mar 2, 2012 1:37:11 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 1 deleted
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109605 r109609 1 2012-03-02 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] [AC] Connect WebGL to the TextureMapperGL code 4 https://bugs.webkit.org/show_bug.cgi?id=78968 5 6 Reviewed by Gustavo Noronha Silva. 7 8 No new tests. This is covered by existing accelerated compositing and 9 WebGL tests. 10 11 Rely on the shared version of GL acquisition from GLContext. This reduces 12 a lot of code and now allows us to connect WebGL into the accelerated compositing 13 rendering path. 14 15 * GNUmakefile.list.am: GLContext should be included for all X11 builds now. 16 There are no longer GTK+ specific versions of GraphicsContext3D. 17 * platform/graphics/GraphicsContext3D.h: Add a default argument for 18 resolveMultisamplingIfNecessary. This will resolve the entire texture. 19 * platform/graphics/cairo/GraphicsContext3DCairo.cpp: GraphicsContext3D is 20 now responsible for creating GraphicsContext3DPrivate in the constructor. 21 (WebCore::GraphicsContext3D::platformLayer): Now return m_private. 22 * platform/graphics/cairo/GraphicsContext3DPrivate.cpp: Added. 23 * platform/graphics/cairo/GraphicsContext3DPrivate.h: Renamed from Source/WebCore/platform/graphics/glx/GraphicsContext3DPrivate.h. 24 * platform/graphics/glx/GraphicsContext3DPrivate.cpp: Removed. 25 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: 26 (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): Properly 27 handle the default argument. 28 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: 29 (WebCore::GraphicsContext3D::prepareTexture): Use the new default argument now. 30 (WebCore::GraphicsContext3D::readRenderingResults): Ditto. 31 1 32 2012-02-18 Martin Robinson <mrobinson@igalia.com> 2 33 -
trunk/Source/WebCore/GNUmakefile.list.am
r109605 r109609 4630 4630 if TARGET_X11 4631 4631 webcoregtk_sources += \ 4632 Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \ 4633 Source/WebCore/platform/graphics/gtk/GLContextGtk.cpp \ 4634 Source/WebCore/platform/graphics/cairo/GLContext.h \ 4632 4635 Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \ 4633 4636 Source/WebCore/plugins/gtk/gtk2xtbin.c \ … … 5746 5749 Source/WebCore/platform/graphics/cairo/DrawingBufferCairo.cpp \ 5747 5750 Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp \ 5748 Source/WebCore/platform/graphics/ glx/GraphicsContext3DPrivate.cpp \5749 Source/WebCore/platform/graphics/ glx/GraphicsContext3DPrivate.h \5751 Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp \ 5752 Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h \ 5750 5753 Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \ 5751 5754 Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \ … … 5825 5828 if USE_TEXTURE_MAPPER_GL 5826 5829 webcore_sources += \ 5827 Source/WebCore/platform/graphics/cairo/GLContext.h \5828 Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \5829 5830 Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp \ 5830 5831 Source/WebCore/platform/graphics/texmap/TextureMapperGL.h \ … … 5846 5847 Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h \ 5847 5848 Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h 5848 webcoregtk_sources += \5849 Source/WebCore/platform/graphics/gtk/GLContextGtk.cpp5850 5849 endif # END USE_TEXTURE_MAPPER_GL 5851 5850 endif # USE_ACCELERATED_COMPOSITING -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r108597 r109609 27 27 #define GraphicsContext3D_h 28 28 29 #include "IntRect.h" 29 30 #include "GraphicsLayer.h" 30 31 #include "GraphicsTypes3D.h" 31 32 #include "PlatformString.h" 32 33 33 #include <wtf/HashMap.h> 34 34 #include <wtf/ListHashSet.h> … … 914 914 915 915 bool reshapeFBOs(const IntSize&); 916 void resolveMultisamplingIfNecessary(const IntRect& );916 void resolveMultisamplingIfNecessary(const IntRect& = IntRect()); 917 917 918 918 int m_currentWidth, m_currentHeight; -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
r108289 r109609 28 28 #include "config.h" 29 29 #include "GraphicsContext3D.h" 30 #include "PlatformContextCairo.h"31 30 32 31 #if ENABLE(WEBGL) … … 36 35 #include "Image.h" 37 36 #include "OpenGLShims.h" 37 #include "PlatformContextCairo.h" 38 38 #include "RefPtrCairo.h" 39 39 #include "ShaderLang.h" 40 40 #include <cairo.h> 41 #include <wtf/NotFound.h> 42 #include <wtf/OwnPtr.h> 41 43 #include <wtf/PassOwnPtr.h> 42 44 … … 49 51 return 0; 50 52 51 OwnPtr<GraphicsContext3DPrivate> priv = GraphicsContext3DPrivate::create(); 52 if (!priv) 53 static bool initialized = false; 54 static bool success = true; 55 if (!initialized) { 56 success = initializeOpenGLShims(); 57 initialized = true; 58 } 59 if (!success) 53 60 return 0; 54 61 55 62 RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attributes, hostWindow, false)); 56 context->m_private = priv.release();57 63 return context.release(); 58 64 } 59 65 60 GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow* , bool)66 GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow* hostWindow, bool) 61 67 : m_currentWidth(0) 62 68 , m_currentHeight(0) … … 69 75 , m_multisampleDepthStencilBuffer(0) 70 76 , m_multisampleColorBuffer(0) 71 { 72 GraphicsContext3DPrivate::addActiveGraphicsContext(this); 77 , m_private(GraphicsContext3DPrivate::create(this, hostWindow)) 78 { 79 makeContextCurrent(); 73 80 74 81 validateAttributes(); … … 124 131 GraphicsContext3D::~GraphicsContext3D() 125 132 { 126 GraphicsContext3DPrivate::removeActiveGraphicsContext(this);127 if (!m_private->m_context)128 return;129 130 133 makeContextCurrent(); 131 134 ::glDeleteTextures(1, &m_texture); … … 229 232 return m_private->makeContextCurrent(); 230 233 } 231 232 234 PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() 233 235 { 234 return m_private-> m_context;236 return m_private->platformContext(); 235 237 } 236 238 … … 243 245 PlatformLayer* GraphicsContext3D::platformLayer() const 244 246 { 245 return 0;247 return m_private.get(); 246 248 } 247 249 #endif -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h
-
Property
svn:eol-style
changed from
native
toLF
r109605 r109609 21 21 #define GraphicsContext3DPrivate_h 22 22 23 #include "GLContext.h" 24 #include "GraphicsContext3D.h" 23 25 #include <wtf/PassOwnPtr.h> 24 26 25 typedef struct __GLXcontextRec *GLXContext; 26 typedef unsigned long GLXPbuffer; 27 typedef unsigned long GLXPixmap; 28 typedef unsigned char GLubyte; 29 typedef unsigned long Pixmap; 27 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) 28 #include "TextureMapper.h" 29 #endif 30 30 31 31 namespace WebCore { 32 32 33 class GraphicsContext3D; 34 35 class GraphicsContext3DPrivate { 33 class GraphicsContext3DPrivate 34 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) 35 : public TextureMapperPlatformLayer 36 #endif 37 { 36 38 public: 37 static PassOwnPtr<GraphicsContext3DPrivate> create( );39 static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*, HostWindow*); 38 40 ~GraphicsContext3DPrivate(); 39 41 bool makeContextCurrent(); 42 PlatformGraphicsContext3D platformContext(); 43 44 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) 45 virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity, BitmapTexture* mask); 46 #endif 40 47 41 48 private: 42 friend class GraphicsContext3D; 43 static GraphicsContext3DPrivate* createPbufferContext(); 44 static GraphicsContext3DPrivate* createPixmapContext(); 45 GraphicsContext3DPrivate(GLXContext, GLXPbuffer); 46 GraphicsContext3DPrivate(GLXContext, Pixmap, GLXPixmap); 49 GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*); 47 50 48 static void addActiveGraphicsContext(GraphicsContext3D*); 49 static void removeActiveGraphicsContext(GraphicsContext3D*); 50 static void cleanupActiveContextsAtExit(); 51 52 GLXContext m_context; 53 GLXPbuffer m_pbuffer; 54 Pixmap m_pixmap; 55 GLXPixmap m_glxPixmap; 51 GraphicsContext3D* m_context; 52 HostWindow* m_window; 53 GLContext* m_glContext; 56 54 }; 57 55 -
Property
svn:eol-style
changed from
-
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
r107945 r109609 136 136 ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO); 137 137 ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo); 138 ::glBlitFramebufferEXT(rect.x(), rect.y(), rect.maxX(), rect.maxY(), rect.x(), rect.y(), rect.maxX(), rect.maxY(), GL_COLOR_BUFFER_BIT, GL_LINEAR); 138 139 IntRect resolveRect = rect; 140 if (rect.isEmpty()) 141 resolveRect = IntRect(0, 0, m_currentWidth, m_currentHeight); 142 143 ::glBlitFramebufferEXT(resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), GL_COLOR_BUFFER_BIT, GL_LINEAR); 139 144 } 140 145 -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
r107945 r109609 169 169 makeContextCurrent(); 170 170 if (m_attrs.antialias) 171 resolveMultisamplingIfNecessary( IntRect(0, 0, m_currentWidth, m_currentHeight));171 resolveMultisamplingIfNecessary(); 172 172 173 173 ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); … … 192 192 bool mustRestoreFBO = false; 193 193 if (m_attrs.antialias) { 194 resolveMultisamplingIfNecessary( IntRect(0, 0, m_currentWidth, m_currentHeight));194 resolveMultisamplingIfNecessary(); 195 195 ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); 196 196 mustRestoreFBO = true;
Note: See TracChangeset
for help on using the changeset viewer.