| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 GL_RGBA16I, | 128 GL_RGBA16I, |
| 129 GL_RGBA32UI, | 129 GL_RGBA32UI, |
| 130 GL_RGBA32I, | 130 GL_RGBA32I, |
| 131 GL_DEPTH_COMPONENT16, | 131 GL_DEPTH_COMPONENT16, |
| 132 GL_DEPTH_COMPONENT24, | 132 GL_DEPTH_COMPONENT24, |
| 133 GL_DEPTH_COMPONENT32F, | 133 GL_DEPTH_COMPONENT32F, |
| 134 GL_DEPTH24_STENCIL8, | 134 GL_DEPTH24_STENCIL8, |
| 135 GL_DEPTH32F_STENCIL8, | 135 GL_DEPTH32F_STENCIL8, |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 const GLenum kCompressedTextureFormatsETC2EAC[] = { | |
| 139 GL_COMPRESSED_R11_EAC, | |
| 140 GL_COMPRESSED_SIGNED_R11_EAC, | |
| 141 GL_COMPRESSED_RG11_EAC, | |
| 142 GL_COMPRESSED_SIGNED_RG11_EAC, | |
| 143 GL_COMPRESSED_RGB8_ETC2, | |
| 144 GL_COMPRESSED_SRGB8_ETC2, | |
| 145 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, | |
| 146 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, | |
| 147 GL_COMPRESSED_RGBA8_ETC2_EAC, | |
| 148 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, | |
| 149 }; | |
| 150 | |
| 151 WebGL2RenderingContextBase::WebGL2RenderingContextBase( | 138 WebGL2RenderingContextBase::WebGL2RenderingContextBase( |
| 152 HTMLCanvasElement* passedCanvas, | 139 HTMLCanvasElement* passedCanvas, |
| 153 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider, | 140 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider, |
| 154 const CanvasContextCreationAttributes& requestedAttributes) | 141 const CanvasContextCreationAttributes& requestedAttributes) |
| 155 : WebGLRenderingContextBase(passedCanvas, | 142 : WebGLRenderingContextBase(passedCanvas, |
| 156 std::move(contextProvider), | 143 std::move(contextProvider), |
| 157 requestedAttributes, | 144 requestedAttributes, |
| 158 2) { | 145 2) { |
| 159 m_supportedInternalFormatsStorage.insert( | 146 m_supportedInternalFormatsStorage.insert( |
| 160 kSupportedInternalFormatsStorage, | 147 kSupportedInternalFormatsStorage, |
| 161 kSupportedInternalFormatsStorage + | 148 kSupportedInternalFormatsStorage + |
| 162 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage)); | 149 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage)); |
| 163 m_supportedInternalFormatsStorage.insert( | |
| 164 kCompressedTextureFormatsETC2EAC, | |
| 165 kCompressedTextureFormatsETC2EAC + | |
| 166 WTF_ARRAY_LENGTH(kCompressedTextureFormatsETC2EAC)); | |
| 167 m_compressedTextureFormatsETC2EAC.insert( | |
| 168 kCompressedTextureFormatsETC2EAC, | |
| 169 kCompressedTextureFormatsETC2EAC + | |
| 170 WTF_ARRAY_LENGTH(kCompressedTextureFormatsETC2EAC)); | |
| 171 m_compressedTextureFormats.append( | |
| 172 kCompressedTextureFormatsETC2EAC, | |
| 173 WTF_ARRAY_LENGTH(kCompressedTextureFormatsETC2EAC)); | |
| 174 } | 150 } |
| 175 | 151 |
| 176 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() { | 152 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() { |
| 177 m_readFramebufferBinding = nullptr; | 153 m_readFramebufferBinding = nullptr; |
| 178 | 154 |
| 179 m_boundCopyReadBuffer = nullptr; | 155 m_boundCopyReadBuffer = nullptr; |
| 180 m_boundCopyWriteBuffer = nullptr; | 156 m_boundCopyWriteBuffer = nullptr; |
| 181 m_boundPixelPackBuffer = nullptr; | 157 m_boundPixelPackBuffer = nullptr; |
| 182 m_boundPixelUnpackBuffer = nullptr; | 158 m_boundPixelUnpackBuffer = nullptr; |
| 183 m_boundTransformFeedbackBuffer = nullptr; | 159 m_boundTransformFeedbackBuffer = nullptr; |
| (...skipping 4321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4505 params.skipPixels = m_unpackSkipPixels; | 4481 params.skipPixels = m_unpackSkipPixels; |
| 4506 params.skipRows = m_unpackSkipRows; | 4482 params.skipRows = m_unpackSkipRows; |
| 4507 if (dimension == Tex3D) { | 4483 if (dimension == Tex3D) { |
| 4508 params.imageHeight = m_unpackImageHeight; | 4484 params.imageHeight = m_unpackImageHeight; |
| 4509 params.skipImages = m_unpackSkipImages; | 4485 params.skipImages = m_unpackSkipImages; |
| 4510 } | 4486 } |
| 4511 return params; | 4487 return params; |
| 4512 } | 4488 } |
| 4513 | 4489 |
| 4514 } // namespace blink | 4490 } // namespace blink |
| OLD | NEW |