| 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/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/frame/ImageBitmap.h" | 9 #include "core/frame/ImageBitmap.h" |
| 10 #include "core/html/HTMLCanvasElement.h" | 10 #include "core/html/HTMLCanvasElement.h" |
| (...skipping 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3683 m_readFramebufferBinding = nullptr; | 3683 m_readFramebufferBinding = nullptr; |
| 3684 } else { | 3684 } else { |
| 3685 target = GL_DRAW_FRAMEBUFFER; | 3685 target = GL_DRAW_FRAMEBUFFER; |
| 3686 m_framebufferBinding = nullptr; | 3686 m_framebufferBinding = nullptr; |
| 3687 } | 3687 } |
| 3688 } else if (framebuffer == m_readFramebufferBinding) { | 3688 } else if (framebuffer == m_readFramebufferBinding) { |
| 3689 target = GL_READ_FRAMEBUFFER; | 3689 target = GL_READ_FRAMEBUFFER; |
| 3690 m_readFramebufferBinding = nullptr; | 3690 m_readFramebufferBinding = nullptr; |
| 3691 } | 3691 } |
| 3692 if (target) { | 3692 if (target) { |
| 3693 drawingBuffer()->setFramebufferBinding(target, 0); | |
| 3694 // Have to call drawingBuffer()->bind() here to bind back to internal fbo. | 3693 // Have to call drawingBuffer()->bind() here to bind back to internal fbo. |
| 3695 drawingBuffer()->bind(target); | 3694 drawingBuffer()->bind(target); |
| 3696 } | 3695 } |
| 3697 } | 3696 } |
| 3698 | 3697 |
| 3699 ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState, | 3698 ScriptValue WebGL2RenderingContextBase::getParameter(ScriptState* scriptState, |
| 3700 GLenum pname) { | 3699 GLenum pname) { |
| 3701 if (isContextLost()) | 3700 if (isContextLost()) |
| 3702 return ScriptValue::createNull(scriptState); | 3701 return ScriptValue::createNull(scriptState); |
| 3703 switch (pname) { | 3702 switch (pname) { |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4716 params.rowLength = m_unpackRowLength; | 4715 params.rowLength = m_unpackRowLength; |
| 4717 params.skipPixels = m_unpackSkipPixels; | 4716 params.skipPixels = m_unpackSkipPixels; |
| 4718 params.skipRows = m_unpackSkipRows; | 4717 params.skipRows = m_unpackSkipRows; |
| 4719 if (dimension == Tex3D) { | 4718 if (dimension == Tex3D) { |
| 4720 params.imageHeight = m_unpackImageHeight; | 4719 params.imageHeight = m_unpackImageHeight; |
| 4721 params.skipImages = m_unpackSkipImages; | 4720 params.skipImages = m_unpackSkipImages; |
| 4722 } | 4721 } |
| 4723 return params; | 4722 return params; |
| 4724 } | 4723 } |
| 4725 | 4724 |
| 4725 void WebGL2RenderingContextBase:: |
| 4726 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 4727 if (!contextGL()) |
| 4728 return; |
| 4729 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 4730 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 4731 } |
| 4732 |
| 4726 } // namespace blink | 4733 } // namespace blink |
| OLD | NEW |