WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-92441-20120829131753.patch (text/plain), 9.28 KB, created by
Martin Robinson
on 2012-08-29 13:18:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Martin Robinson
Created:
2012-08-29 13:18:03 PDT
Size:
9.28 KB
patch
obsolete
>Subversion Revision: 126964 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 137789d4a520808e7d5f742625a797e16d0a6dad..f51c2a97f5f4d107598ec2b063b5eac29d271342 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,33 @@ >+2012-08-29 Martin Robinson <mrobinson@igalia.com> >+ >+ [TexMap][cairo] Add GC3D::RenderToCurrentGLContext support >+ https://bugs.webkit.org/show_bug.cgi?id=92441 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a RenderToCurrentGLContext for the Cairo GraphicsContext3D. This will allow >+ TextureMapperGL to be rewritten on top of GraphicsContext3D by exposing the GC3D >+ interface for the widget's GL context. >+ >+ No new tests. This will be covered by the existing AC tests after the patch on >+ bug 78672 lands. >+ >+ * platform/graphics/cairo/GraphicsContext3DCairo.cpp: >+ (WebCore::GraphicsContext3D::GraphicsContext3D): Only create the offscreen >+ rendering buffers if we are rendering offscreen. Pass the rendering style to >+ the private data factory. >+ (WebCore::GraphicsContext3D::~GraphicsContext3D): Only destroy the offscreen >+ rendering buffers if we are rendering offscreen. >+ * platform/graphics/cairo/GraphicsContext3DPrivate.cpp: >+ (WebCore::GraphicsContext3DPrivate::create): Pass the rendering style through. >+ (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): If we are using >+ a "current GL context" rendering style, we don't need to create a GL context. >+ We'll always just use the one that's currently active. >+ (WebCore::GraphicsContext3DPrivate::paintToTextureMapper): Assert that we only >+ do this with the offscreen rendering style. >+ * platform/graphics/cairo/GraphicsContext3DPrivate.h: Update method definitions >+ and expose the rendering style member GraphicsContext3D. >+ > 2012-08-28 Yoshifumi Inoue <yosin@chromium.org> > > [Forms] Make HTMLInputElement::blur()/focus() override-able by input type >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp >index 64a2faaa0e2ac2da28ba9e9b0c253f16d35f51e7..dc12f6c5d62d6471e549edd8e0af4d4382690114 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp >@@ -65,7 +65,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri > return context.release(); > } > >-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, GraphicsContext3D::RenderStyle) >+GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle) > : m_currentWidth(0) > , m_currentHeight(0) > , m_attrs(attributes) >@@ -78,37 +78,39 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, H > , m_multisampleFBO(0) > , m_multisampleDepthStencilBuffer(0) > , m_multisampleColorBuffer(0) >- , m_private(GraphicsContext3DPrivate::create(this)) >+ , m_private(GraphicsContext3DPrivate::create(this, renderStyle)) > { > makeContextCurrent(); > > validateAttributes(); > >- // Create a texture to render into. >- ::glGenTextures(1, &m_texture); >- ::glBindTexture(GL_TEXTURE_2D, m_texture); >- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); >- ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); >- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); >- ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); >- ::glBindTexture(GL_TEXTURE_2D, 0); >- >- // Create an FBO. >- ::glGenFramebuffersEXT(1, &m_fbo); >- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); >- >- m_boundFBO = m_fbo; >- if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) >- ::glGenRenderbuffersEXT(1, &m_depthStencilBuffer); >- >- // Create a multisample FBO. >- if (m_attrs.antialias) { >- ::glGenFramebuffersEXT(1, &m_multisampleFBO); >- ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO); >- m_boundFBO = m_multisampleFBO; >- ::glGenRenderbuffersEXT(1, &m_multisampleColorBuffer); >- if (m_attrs.stencil || m_attrs.depth) >- ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer); >+ if (renderStyle == RenderOffscreen) { >+ // Create a texture to render into. >+ ::glGenTextures(1, &m_texture); >+ ::glBindTexture(GL_TEXTURE_2D, m_texture); >+ ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); >+ ::glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); >+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); >+ ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); >+ ::glBindTexture(GL_TEXTURE_2D, 0); >+ >+ // Create an FBO. >+ ::glGenFramebuffersEXT(1, &m_fbo); >+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); >+ >+ m_boundFBO = m_fbo; >+ if (!m_attrs.antialias && (m_attrs.stencil || m_attrs.depth)) >+ ::glGenRenderbuffersEXT(1, &m_depthStencilBuffer); >+ >+ // Create a multisample FBO. >+ if (m_attrs.antialias) { >+ ::glGenFramebuffersEXT(1, &m_multisampleFBO); >+ ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO); >+ m_boundFBO = m_multisampleFBO; >+ ::glGenRenderbuffersEXT(1, &m_multisampleColorBuffer); >+ if (m_attrs.stencil || m_attrs.depth) >+ ::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer); >+ } > } > > // ANGLE initialization. >@@ -134,6 +136,9 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, H > > GraphicsContext3D::~GraphicsContext3D() > { >+ if (m_private->renderStyle() == RenderToCurrentGLContext) >+ return; >+ > makeContextCurrent(); > ::glDeleteTextures(1, &m_texture); > if (m_attrs.antialias) { >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp >index 7d6629f69dfe57f861cf58d72dbe429e6132e6b1..6b4cbead7c0f6d58d357ff276f6d597ffd7e7820 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp >@@ -36,15 +36,25 @@ using namespace std; > > namespace WebCore { > >-PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context) >+PassOwnPtr<GraphicsContext3DPrivate> GraphicsContext3DPrivate::create(GraphicsContext3D* context, GraphicsContext3D::RenderStyle renderStyle) > { >- return adoptPtr(new GraphicsContext3DPrivate(context)); >+ return adoptPtr(new GraphicsContext3DPrivate(context, renderStyle)); > } > >-GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context) >+GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, GraphicsContext3D::RenderStyle renderStyle) > : m_context(context) >- , m_glContext(GLContext::createOffscreenContext(GLContext::sharingContext())) >+ , m_renderStyle(renderStyle) > { >+ switch (renderStyle) { >+ case GraphicsContext3D::RenderOffscreen: >+ m_glContext = GLContext::createOffscreenContext(GLContext::sharingContext()); >+ break; >+ case GraphicsContext3D::RenderToCurrentGLContext: >+ break; >+ case GraphicsContext3D::RenderDirectlyToHostWindow: >+ ASSERT_NOT_REACHED(); >+ break; >+ } > } > > GraphicsContext3DPrivate::~GraphicsContext3DPrivate() >@@ -67,6 +77,8 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper > if (!m_glContext) > return; > >+ ASSERT(m_renderStyle == GraphicsContext3D::RenderOffscreen); >+ > // FIXME: We do not support mask for the moment with TextureMapperImageBuffer. > if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode) { > GraphicsContext* context = textureMapper->graphicsContext(); >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h >index f1dba82259101d9d9e6d1691d0fa8aad4a9798f5..69dad6754722ac7a882ca87615ab8854979afbc6 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h >@@ -36,20 +36,23 @@ class GraphicsContext3DPrivate > #endif > { > public: >- static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*); >+ static PassOwnPtr<GraphicsContext3DPrivate> create(GraphicsContext3D*, GraphicsContext3D::RenderStyle); > ~GraphicsContext3DPrivate(); > bool makeContextCurrent(); > PlatformGraphicsContext3D platformContext(); > >+ GraphicsContext3D::RenderStyle renderStyle() { return m_renderStyle; } >+ > #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) > virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity, BitmapTexture* mask); > #endif > > private: >- GraphicsContext3DPrivate(GraphicsContext3D*); >+ GraphicsContext3DPrivate(GraphicsContext3D*, GraphicsContext3D::RenderStyle); > > GraphicsContext3D* m_context; > OwnPtr<GLContext> m_glContext; >+ GraphicsContext3D::RenderStyle m_renderStyle; > }; > > }
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 92441
: 161295