| OLD | NEW |
| 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 3517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3528 m_readFramebufferBinding = nullptr; | 3528 m_readFramebufferBinding = nullptr; |
| 3529 } else { | 3529 } else { |
| 3530 target = GL_DRAW_FRAMEBUFFER; | 3530 target = GL_DRAW_FRAMEBUFFER; |
| 3531 m_framebufferBinding = nullptr; | 3531 m_framebufferBinding = nullptr; |
| 3532 } | 3532 } |
| 3533 } else if (framebuffer == m_readFramebufferBinding) { | 3533 } else if (framebuffer == m_readFramebufferBinding) { |
| 3534 target = GL_READ_FRAMEBUFFER; | 3534 target = GL_READ_FRAMEBUFFER; |
| 3535 m_readFramebufferBinding = nullptr; | 3535 m_readFramebufferBinding = nullptr; |
| 3536 } | 3536 } |
| 3537 if (target) { | 3537 if (target) { |
| 3538 drawingBuffer()->setFramebufferBinding(target, 0); | |
| 3539 // Have to call drawingBuffer()->bind() here to bind back to internal fbo. | 3538 // Have to call drawingBuffer()->bind() here to bind back to internal fbo. |
| 3540 drawingBuffer()->bind(target); | 3539 drawingBuffer()->bind(target); |
| 3541 } | 3540 } |
| 3542 } | 3541 } |
| 3543 | 3542 |
| 3544 ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState, | 3543 ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState, |
| 3545 GLenum pname) { | 3544 GLenum pname) { |
| 3546 if (isContextLost()) | 3545 if (isContextLost()) |
| 3547 return ScriptValue::createNull(scriptState); | 3546 return ScriptValue::createNull(scriptState); |
| 3548 switch (pname) { | 3547 switch (pname) { |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4474 params.rowLength = m_unpackRowLength; | 4473 params.rowLength = m_unpackRowLength; |
| 4475 params.skipPixels = m_unpackSkipPixels; | 4474 params.skipPixels = m_unpackSkipPixels; |
| 4476 params.skipRows = m_unpackSkipRows; | 4475 params.skipRows = m_unpackSkipRows; |
| 4477 if (dimension == Tex3D) { | 4476 if (dimension == Tex3D) { |
| 4478 params.imageHeight = m_unpackImageHeight; | 4477 params.imageHeight = m_unpackImageHeight; |
| 4479 params.skipImages = m_unpackSkipImages; | 4478 params.skipImages = m_unpackSkipImages; |
| 4480 } | 4479 } |
| 4481 return params; | 4480 return params; |
| 4482 } | 4481 } |
| 4483 | 4482 |
| 4483 void WebGL2RenderingContextBase::GetDrawingBufferRestoreState( |
| 4484 DrawingBufferRestoreState* restoreState) { |
| 4485 WebGLRenderingContextBase::GetDrawingBufferRestoreState(restoreState); |
| 4486 restoreState->readFramebufferBinding = |
| 4487 objectOrZero(m_readFramebufferBinding.get()); |
| 4488 restoreState->pixelUnpackBufferBinding = |
| 4489 objectOrZero(m_boundPixelUnpackBuffer.get()); |
| 4490 } |
| 4491 |
| 4484 } // namespace blink | 4492 } // namespace blink |
| OLD | NEW |