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

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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa89b61043337bef639bdfac0d77ade1298c2e68..ab219c980adc7321ac32500c5923f963a0279ce0 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1388,6 +1388,10 @@ void WebGLRenderingContextBase::reshape(int width, int height)
if (isContextLost())
return;
+ if (isWebGL2OrHigher()) {
+ contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ }
+
// 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 +1420,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 +1525,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));
}
@@ -2030,8 +2038,10 @@ bool WebGLRenderingContextBase::deleteObject(WebGLObject* object)
void WebGLRenderingContextBase::deleteBuffer(WebGLBuffer* buffer)
{
+ GLuint bufferName = objectOrZero(buffer);
if (!deleteObject(buffer))
return;
+ drawingBuffer()->notifyBufferDeleted(bufferName);
removeBoundBuffer(buffer);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698