Index: Source/platform/graphics/gpu/DrawingBuffer.h |
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.h b/Source/platform/graphics/gpu/DrawingBuffer.h |
index c65dd5d64f9822dba83ca1f23a3bd120c0004ae6..946145eb8f891a357c3b6db55cebff679105c75a 100644 |
--- a/Source/platform/graphics/gpu/DrawingBuffer.h |
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h |
@@ -124,7 +124,23 @@ public: |
// The DrawingBuffer needs to track the currently bound framebuffer so it |
// restore the binding when needed. |
- void setFramebufferBinding(Platform3DObject fbo) { m_framebufferBinding = fbo; } |
+ void setFramebufferBinding(GLenum target, Platform3DObject fbo) |
+ { |
+ switch (target) { |
+ case GL_FRAMEBUFFER: |
+ m_drawFramebufferBinding = fbo; |
+ m_readFramebufferBinding = fbo; |
+ break; |
+ case GL_DRAW_FRAMEBUFFER: |
+ m_drawFramebufferBinding = fbo; |
+ break; |
+ case GL_READ_FRAMEBUFFER: |
+ m_readFramebufferBinding = fbo; |
+ break; |
+ default: |
+ ASSERT(0); |
+ } |
+ } |
// Track the currently active texture unit. Texture unit 0 is used as host for a scratch |
// texture. |
@@ -166,6 +182,10 @@ public: |
int sampleCount() const { return m_sampleCount; } |
bool explicitResolveOfMultisampleData() const { return m_multisampleMode == ExplicitResolve; }; |
+ // Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not 0. |
+ // Otherwise, bind to the default FBO. |
+ void restoreFramebufferBindings(); |
+ |
protected: // For unittests |
DrawingBuffer( |
PassOwnPtr<WebGraphicsContext3D>, |
@@ -188,9 +208,6 @@ private: |
bool resizeMultisampleFramebuffer(const IntSize&); |
void resizeDepthStencil(const IntSize&); |
- // Bind to the m_framebufferBinding if it's not 0. Otherwise, bind to the default FBO. |
- void restoreFramebufferBinding(); |
- |
void clearPlatformLayer(); |
PassRefPtr<MailboxInfo> recycledMailbox(); |
@@ -226,7 +243,8 @@ private: |
PreserveDrawingBuffer m_preserveDrawingBuffer; |
bool m_scissorEnabled; |
Platform3DObject m_texture2DBinding; |
- Platform3DObject m_framebufferBinding; |
+ Platform3DObject m_drawFramebufferBinding; |
+ Platform3DObject m_readFramebufferBinding; |
GLenum m_activeTextureUnit; |
OwnPtr<WebGraphicsContext3D> m_context; |