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

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: Fixed gpu_unittests after last refactor. 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
« no previous file with comments | « gpu/command_buffer/service/texture_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698