Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1925093002: Handle compressed textures allocated via TexStorage2D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move IsCompressedTextureFormat into GLES2Decoder. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid 3D target" ); 773 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid 3D target" );
774 return false; 774 return false;
775 } 775 }
776 } 776 }
777 777
778 if (functionType == TexStorageType3D && target != GL_TEXTURE_2D_ARRAY && m_c ompressedTextureFormatsETC2EAC.find(internalformat) != m_compressedTextureFormat sETC2EAC.end()) { 778 if (functionType == TexStorageType3D && target != GL_TEXTURE_2D_ARRAY && m_c ompressedTextureFormatsETC2EAC.find(internalformat) != m_compressedTextureFormat sETC2EAC.end()) {
779 synthesizeGLError(GL_INVALID_OPERATION, functionName, "target for ETC2/E AC internal formats must be TEXTURE_2D_ARRAY"); 779 synthesizeGLError(GL_INVALID_OPERATION, functionName, "target for ETC2/E AC internal formats must be TEXTURE_2D_ARRAY");
780 return false; 780 return false;
781 } 781 }
782 782
783 if (m_supportedInternalFormatsStorage.find(internalformat) == m_supportedInt ernalFormatsStorage.end()) { 783 if (m_supportedInternalFormatsStorage.find(internalformat) == m_supportedInt ernalFormatsStorage.end()
784 && (functionType == TexStorageType2D && !m_compressedTextureFormats.cont ains(internalformat))) {
784 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat "); 785 synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid internalformat ");
785 return false; 786 return false;
786 } 787 }
787 788
788 if (width <= 0 || height <= 0 || depth <= 0) { 789 if (width <= 0 || height <= 0 || depth <= 0) {
789 synthesizeGLError(GL_INVALID_VALUE, functionName, "invalid dimensions"); 790 synthesizeGLError(GL_INVALID_VALUE, functionName, "invalid dimensions");
790 return false; 791 return false;
791 } 792 }
792 793
793 if (levels <= 0) { 794 if (levels <= 0) {
(...skipping 2784 matching lines...) Expand 10 before | Expand all | Expand 10 after
3578 params.skipPixels = m_unpackSkipPixels; 3579 params.skipPixels = m_unpackSkipPixels;
3579 params.skipRows = m_unpackSkipRows; 3580 params.skipRows = m_unpackSkipRows;
3580 if (dimension == Tex3D) { 3581 if (dimension == Tex3D) {
3581 params.imageHeight = m_unpackImageHeight; 3582 params.imageHeight = m_unpackImageHeight;
3582 params.skipImages = m_unpackSkipImages; 3583 params.skipImages = m_unpackSkipImages;
3583 } 3584 }
3584 return params; 3585 return params;
3585 } 3586 }
3586 3587
3587 } // namespace blink 3588 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698