| 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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid 3D target"
); | 772 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid 3D target"
); |
| 773 return false; | 773 return false; |
| 774 } | 774 } |
| 775 } | 775 } |
| 776 | 776 |
| 777 if (functionType == TexStorageType3D && target != GL_TEXTURE_2D_ARRAY && m_c
ompressedTextureFormatsETC2EAC.find(internalformat) != m_compressedTextureFormat
sETC2EAC.end()) { | 777 if (functionType == TexStorageType3D && target != GL_TEXTURE_2D_ARRAY && m_c
ompressedTextureFormatsETC2EAC.find(internalformat) != m_compressedTextureFormat
sETC2EAC.end()) { |
| 778 synthesizeGLError(GL_INVALID_OPERATION, functionName, "target for ETC2/E
AC internal formats must be TEXTURE_2D_ARRAY"); | 778 synthesizeGLError(GL_INVALID_OPERATION, functionName, "target for ETC2/E
AC internal formats must be TEXTURE_2D_ARRAY"); |
| 779 return false; | 779 return false; |
| 780 } | 780 } |
| 781 | 781 |
| 782 if (m_supportedInternalFormatsStorage.find(internalformat) == m_supportedInt
ernalFormatsStorage.end()) { | 782 if (m_supportedInternalFormatsStorage.find(internalformat) == m_supportedInt
ernalFormatsStorage.end() |
| 783 && (functionType == TexStorageType2D && !m_compressedTextureFormats.cont
ains(internalformat))) { |
| 783 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat
"); | 784 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat
"); |
| 784 return false; | 785 return false; |
| 785 } | 786 } |
| 786 | 787 |
| 787 if (width <= 0 || height <= 0 || depth <= 0) { | 788 if (width <= 0 || height <= 0 || depth <= 0) { |
| 788 synthesizeGLError(GL_INVALID_VALUE, functionName, "invalid dimensions"); | 789 synthesizeGLError(GL_INVALID_VALUE, functionName, "invalid dimensions"); |
| 789 return false; | 790 return false; |
| 790 } | 791 } |
| 791 | 792 |
| 792 if (levels <= 0) { | 793 if (levels <= 0) { |
| (...skipping 2784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3577 params.skipPixels = m_unpackSkipPixels; | 3578 params.skipPixels = m_unpackSkipPixels; |
| 3578 params.skipRows = m_unpackSkipRows; | 3579 params.skipRows = m_unpackSkipRows; |
| 3579 if (dimension == Tex3D) { | 3580 if (dimension == Tex3D) { |
| 3580 params.imageHeight = m_unpackImageHeight; | 3581 params.imageHeight = m_unpackImageHeight; |
| 3581 params.skipImages = m_unpackSkipImages; | 3582 params.skipImages = m_unpackSkipImages; |
| 3582 } | 3583 } |
| 3583 return params; | 3584 return params; |
| 3584 } | 3585 } |
| 3585 | 3586 |
| 3586 } // namespace blink | 3587 } // namespace blink |
| OLD | NEW |