| 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..2ce4693cc0744d891d92c99d3737a4ebdd4c9c2f 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(GLbitfield clearMask, GLenum target = GL_FRAMEBUFFER);
|
|
|
| // 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(Platform3DObject fbo, GLenum target = GL_FRAMEBUFFER)
|
| + {
|
| + 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;
|
| + Platform3DObject m_readFramebufferBinding;
|
| GLenum m_activeTextureUnit;
|
|
|
| OwnPtr<WebGraphicsContext3D> m_context;
|
|
|