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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2407753002: Fix crash from state management cleanup (Closed)
Patch Set: Fix state restore missed Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webgl/WebGL2RenderingContextBase.h" 5 #include "modules/webgl/WebGL2RenderingContextBase.h"
6 6
7 #include "bindings/modules/v8/WebGLAny.h" 7 #include "bindings/modules/v8/WebGLAny.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "core/html/HTMLCanvasElement.h" 9 #include "core/html/HTMLCanvasElement.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
(...skipping 3520 matching lines...) Expand 10 before | Expand all | Expand 10 after
3531 m_readFramebufferBinding = nullptr; 3531 m_readFramebufferBinding = nullptr;
3532 } else { 3532 } else {
3533 target = GL_DRAW_FRAMEBUFFER; 3533 target = GL_DRAW_FRAMEBUFFER;
3534 m_framebufferBinding = nullptr; 3534 m_framebufferBinding = nullptr;
3535 } 3535 }
3536 } else if (framebuffer == m_readFramebufferBinding) { 3536 } else if (framebuffer == m_readFramebufferBinding) {
3537 target = GL_READ_FRAMEBUFFER; 3537 target = GL_READ_FRAMEBUFFER;
3538 m_readFramebufferBinding = nullptr; 3538 m_readFramebufferBinding = nullptr;
3539 } 3539 }
3540 if (target) { 3540 if (target) {
3541 drawingBuffer()->setFramebufferBinding(target, 0);
3542 // Have to call drawingBuffer()->bind() here to bind back to internal fbo. 3541 // Have to call drawingBuffer()->bind() here to bind back to internal fbo.
3543 drawingBuffer()->bind(target); 3542 drawingBuffer()->bind(target);
3544 } 3543 }
3545 } 3544 }
3546 3545
3547 ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState, 3546 ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState,
3548 GLenum pname) { 3547 GLenum pname) {
3549 if (isContextLost()) 3548 if (isContextLost())
3550 return ScriptValue::createNull(scriptState); 3549 return ScriptValue::createNull(scriptState);
3551 switch (pname) { 3550 switch (pname) {
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
4504 params.rowLength = m_unpackRowLength; 4503 params.rowLength = m_unpackRowLength;
4505 params.skipPixels = m_unpackSkipPixels; 4504 params.skipPixels = m_unpackSkipPixels;
4506 params.skipRows = m_unpackSkipRows; 4505 params.skipRows = m_unpackSkipRows;
4507 if (dimension == Tex3D) { 4506 if (dimension == Tex3D) {
4508 params.imageHeight = m_unpackImageHeight; 4507 params.imageHeight = m_unpackImageHeight;
4509 params.skipImages = m_unpackSkipImages; 4508 params.skipImages = m_unpackSkipImages;
4510 } 4509 }
4511 return params; 4510 return params;
4512 } 4511 }
4513 4512
4513 void WebGL2RenderingContextBase::
4514 DrawingBufferClientRestorePixelUnpackBufferBinding() {
4515 if (!contextGL())
4516 return;
4517 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER,
4518 objectOrZero(m_boundPixelUnpackBuffer.get()));
4519 }
4520
4514 } // namespace blink 4521 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698