Index: Source/platform/graphics/gpu/DrawingBuffer.h |
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.h b/Source/platform/graphics/gpu/DrawingBuffer.h |
index 81c98223027a66456c277fb06c4bb9284ae22c54..7a0f89fdf240542ba4c56680ab8f41efa83657b4 100644 |
--- a/Source/platform/graphics/gpu/DrawingBuffer.h |
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h |
@@ -101,7 +101,7 @@ public: |
// Issues a glClear() on all framebuffers associated with this DrawingBuffer. The caller is responsible for |
// making the context current and setting the clear values and masks. Modifies the framebuffer binding. |
- void clearFramebuffers(GLbitfield clearMask); |
+ void clearFramebuffers(GLenum target, GLbitfield clearMask); |
// Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget. |
static IntSize adjustSize(const IntSize& desiredSize, const IntSize& curSize, int maxTextureSize); |
@@ -110,7 +110,7 @@ public: |
IntSize size() const { return m_size; } |
// Copies the multisample color buffer to the normal color buffer and leaves m_fbo bound. |
- void commit(); |
+ void commit(GLenum target = GL_FRAMEBUFFER); |
// commit should copy the full multisample buffer, and not respect the |
// current scissor bounds. Track the state of the scissor test so that it |
@@ -123,7 +123,13 @@ 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) |
Zhenyao Mo
2015/06/04 22:08:17
This should be setFramebufferBinding(Platform3DObj
yunchao
2015/06/09 10:37:55
The call site may just set one binding point, it d
|
+ { |
+ if (target == GL_READ_FRAMEBUFFER) |
+ m_readFramebufferBinding = fbo; |
+ else |
+ m_framebufferBinding = fbo; |
+ } |
// Track the currently active texture unit. Texture unit 0 is used as host for a scratch |
// texture. |
@@ -187,8 +193,9 @@ 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(); |
+ // Bind to m_framebufferBinding or m_readFramebufferBinding if it's not 0. |
+ // Otherwise, bind to the default FBO. |
+ void restoreFramebufferBinding(GLenum target = GL_FRAMEBUFFER); |
void clearPlatformLayer(); |
@@ -226,6 +233,7 @@ private: |
bool m_scissorEnabled; |
Platform3DObject m_texture2DBinding; |
Platform3DObject m_framebufferBinding; |
Zhenyao Mo
2015/06/04 22:08:17
This should be m_drawFramebufferBinding, to be cle
yunchao
2015/06/09 10:37:55
Done.
|
+ Platform3DObject m_readFramebufferBinding; |
GLenum m_activeTextureUnit; |
OwnPtr<WebGraphicsContext3D> m_context; |