Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1295)

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h

Issue 2329523002: Save/restore PBO bindings in DrawingBuffer (Closed)
Patch Set: oops Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
index 737fad85b105be200e68026ac5d0a39a8cd20f5e..3fc461050db472486a51ffd4b757adf7300533a1 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -136,6 +136,19 @@ public:
// The bound texture is tracked to avoid costly queries during rendering.
void setTexture2DBinding(GLuint texture) { m_texture2DBinding = texture; }
+ void setPixelUnpackBufferBinding(GLuint buffer)
+ {
+ DCHECK(m_webGLVersion > WebGL1);
+ m_pixelUnpackBufferBinding = buffer;
+ }
+
+ void notifyBufferDeleted(GLuint buffer)
+ {
+ if (m_webGLVersion > WebGL1 && buffer == m_pixelUnpackBufferBinding) {
+ setPixelUnpackBufferBinding(0);
+ }
+ }
+
// The DrawingBuffer needs to track the currently bound framebuffer so it
// restore the binding when needed.
void setFramebufferBinding(GLenum target, GLuint fbo)
@@ -227,6 +240,8 @@ public:
int sampleCount() const { return m_sampleCount; }
bool explicitResolveOfMultisampleData() const { return m_antiAliasingMode == MSAAExplicitResolve; }
+ void restorePixelUnpackBufferBindings();
+
// Bind to m_drawFramebufferBinding or m_readFramebufferBinding if it's not 0.
// Otherwise, bind to the default FBO.
void restoreFramebufferBindings();
@@ -377,6 +392,7 @@ private:
const WebGLVersion m_webGLVersion;
bool m_scissorEnabled = false;
GLuint m_texture2DBinding = 0;
+ GLuint m_pixelUnpackBufferBinding = 0;
GLuint m_drawFramebufferBinding = 0;
GLuint m_readFramebufferBinding = 0;
GLuint m_renderbufferBinding = 0;

Powered by Google App Engine
This is Rietveld 408576698