| 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 4762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4773 m_boundUniformBuffer = nullptr; | 4773 m_boundUniformBuffer = nullptr; |
| 4774 | 4774 |
| 4775 WebGLRenderingContextBase::removeBoundBuffer(buffer); | 4775 WebGLRenderingContextBase::removeBoundBuffer(buffer); |
| 4776 } | 4776 } |
| 4777 | 4777 |
| 4778 void WebGL2RenderingContextBase::restoreCurrentFramebuffer() { | 4778 void WebGL2RenderingContextBase::restoreCurrentFramebuffer() { |
| 4779 bindFramebuffer(GL_DRAW_FRAMEBUFFER, m_framebufferBinding.get()); | 4779 bindFramebuffer(GL_DRAW_FRAMEBUFFER, m_framebufferBinding.get()); |
| 4780 bindFramebuffer(GL_READ_FRAMEBUFFER, m_readFramebufferBinding.get()); | 4780 bindFramebuffer(GL_READ_FRAMEBUFFER, m_readFramebufferBinding.get()); |
| 4781 } | 4781 } |
| 4782 | 4782 |
| 4783 void WebGL2RenderingContextBase::visitChildDOMWrappers( | |
| 4784 v8::Isolate* isolate, | |
| 4785 const v8::Persistent<v8::Object>& wrapper) { | |
| 4786 if (isContextLost()) { | |
| 4787 return; | |
| 4788 } | |
| 4789 | |
| 4790 WebGLRenderingContextBase::visitChildDOMWrappers(isolate, wrapper); | |
| 4791 | |
| 4792 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4793 wrapper, m_transformFeedbackBinding, isolate); | |
| 4794 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4795 wrapper, m_readFramebufferBinding, isolate); | |
| 4796 | |
| 4797 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4798 wrapper, m_boundCopyReadBuffer, isolate); | |
| 4799 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4800 wrapper, m_boundCopyWriteBuffer, isolate); | |
| 4801 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4802 wrapper, m_boundPixelPackBuffer, isolate); | |
| 4803 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4804 wrapper, m_boundPixelUnpackBuffer, isolate); | |
| 4805 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4806 wrapper, m_boundTransformFeedbackBuffer, isolate); | |
| 4807 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4808 wrapper, m_boundUniformBuffer, isolate); | |
| 4809 | |
| 4810 for (auto& buf : m_boundIndexedTransformFeedbackBuffers) { | |
| 4811 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, buf, isolate); | |
| 4812 } | |
| 4813 | |
| 4814 for (auto& buf : m_boundIndexedUniformBuffers) { | |
| 4815 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, buf, isolate); | |
| 4816 } | |
| 4817 | |
| 4818 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4819 wrapper, m_currentBooleanOcclusionQuery, isolate); | |
| 4820 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4821 wrapper, m_currentTransformFeedbackPrimitivesWrittenQuery, isolate); | |
| 4822 DOMWrapperWorld::setWrapperReferencesInAllWorlds( | |
| 4823 wrapper, m_currentElapsedQuery, isolate); | |
| 4824 | |
| 4825 for (auto& unit : m_samplerUnits) { | |
| 4826 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, unit, isolate); | |
| 4827 } | |
| 4828 } | |
| 4829 | |
| 4830 WebGLImageConversion::PixelStoreParams | 4783 WebGLImageConversion::PixelStoreParams |
| 4831 WebGL2RenderingContextBase::getPackPixelStoreParams() { | 4784 WebGL2RenderingContextBase::getPackPixelStoreParams() { |
| 4832 WebGLImageConversion::PixelStoreParams params; | 4785 WebGLImageConversion::PixelStoreParams params; |
| 4833 params.alignment = m_packAlignment; | 4786 params.alignment = m_packAlignment; |
| 4834 params.rowLength = m_packRowLength; | 4787 params.rowLength = m_packRowLength; |
| 4835 params.skipPixels = m_packSkipPixels; | 4788 params.skipPixels = m_packSkipPixels; |
| 4836 params.skipRows = m_packSkipRows; | 4789 params.skipRows = m_packSkipRows; |
| 4837 return params; | 4790 return params; |
| 4838 } | 4791 } |
| 4839 | 4792 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 4854 | 4807 |
| 4855 void WebGL2RenderingContextBase:: | 4808 void WebGL2RenderingContextBase:: |
| 4856 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 4809 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 4857 if (!contextGL()) | 4810 if (!contextGL()) |
| 4858 return; | 4811 return; |
| 4859 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 4812 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 4860 objectOrZero(m_boundPixelUnpackBuffer.get())); | 4813 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 4861 } | 4814 } |
| 4862 | 4815 |
| 4863 } // namespace blink | 4816 } // namespace blink |
| OLD | NEW |