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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2329523002: Save/restore PBO bindings in DrawingBuffer (Closed)
Patch Set: 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/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index f603d1fdf07ffd11519a415438f9903395773640..2b1fbd049e59a438054dd2a53807534484ecf087 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1388,6 +1388,8 @@ void WebGLRenderingContextBase::reshape(int width, int height)
if (isContextLost())
return;
+ contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
Zhenyao Mo 2016/09/09 18:58:04 You can't do this in WebGL1 because if it's implem
Kai Ninomiya 2016/09/09 20:30:44 Done.
+
// This is an approximation because at WebGLRenderingContextBase level we don't
// know if the underlying FBO uses textures or renderbuffers.
GLint maxSize = std::min(m_maxTextureSize, m_maxRenderbufferSize);
@@ -1416,6 +1418,7 @@ void WebGLRenderingContextBase::reshape(int width, int height)
contextGL()->BindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get()));
contextGL()->BindRenderbuffer(GL_RENDERBUFFER, objectOrZero(m_renderbufferBinding.get()));
drawingBuffer()->restoreFramebufferBindings();
+ drawingBuffer()->restorePixelUnpackBufferBindings();
}
int WebGLRenderingContextBase::drawingBufferWidth() const
@@ -1520,6 +1523,9 @@ void WebGLRenderingContextBase::bindBuffer(GLenum target, WebGLBuffer* buffer)
if (!validateAndUpdateBufferBindTarget("bindBuffer", target, buffer))
return;
+ if (target == GL_PIXEL_UNPACK_BUFFER) {
+ drawingBuffer()->setPixelUnpackBufferBinding(objectOrZero(buffer));
+ }
contextGL()->BindBuffer(target, objectOrZero(buffer));
}
@@ -5983,6 +5989,7 @@ void WebGLRenderingContextBase::removeBoundBuffer(WebGLBuffer* buffer)
if (m_boundArrayBuffer == buffer)
m_boundArrayBuffer = nullptr;
+ drawingBuffer()->notifyBufferDeleted(objectOrZero(buffer));
m_boundVertexArrayObject->unbindBuffer(buffer);
}

Powered by Google App Engine
This is Rietveld 408576698