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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 1403483002: Update CopyTexImage2D to do internal format validation in ES3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unsigned integer format Created 5 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file is here so other GLES2 related files can have a common set of 5 // This file is here so other GLES2 related files can have a common set of
6 // includes where appropriate. 6 // includes where appropriate.
7 7
8 #include <sstream> 8 #include <sstream>
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 return false; 1203 return false;
1204 } 1204 }
1205 } 1205 }
1206 1206
1207 // static 1207 // static
1208 bool GLES2Util::IsIntegerFormat(uint32_t internal_format) { 1208 bool GLES2Util::IsIntegerFormat(uint32_t internal_format) {
1209 return (IsUnsignedIntegerFormat(internal_format) || 1209 return (IsUnsignedIntegerFormat(internal_format) ||
1210 IsSignedIntegerFormat(internal_format)); 1210 IsSignedIntegerFormat(internal_format));
1211 } 1211 }
1212 1212
1213 // static
1214 bool GLES2Util::IsFloatFormat(uint32_t internal_format) {
1215 switch (internal_format) {
1216 case GL_R16F:
1217 case GL_R32F:
1218 case GL_RG16F:
1219 case GL_RG32F:
1220 case GL_R11F_G11F_B10F:
1221 case GL_RGB16F:
1222 case GL_RGB32F:
1223 case GL_RGBA16F:
1224 case GL_RGBA32F:
1225 case GL_DEPTH_COMPONENT32F:
1226 case GL_DEPTH32F_STENCIL8:
Zhenyao Mo 2015/10/13 01:19:31 I think you only need to include color formats.
qiankun 2015/10/13 14:28:01 Done.
1227 return true;
1228 default:
1229 return false;
1230 }
1231 }
1232
1233 // static
1234 bool GLES2Util::IsSRGBFormat(uint32_t internal_format) {
1235 switch (internal_format) {
1236 case GL_SRGB8:
1237 case GL_SRGB8_ALPHA8:
1238 case GL_COMPRESSED_SRGB8_ETC2:
1239 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
1240 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
Zhenyao Mo 2015/10/13 01:19:32 I don't think you need to include compressed forma
qiankun 2015/10/13 14:28:01 Done.
1241 return true;
1242 default:
1243 return false;
1244 }
1245 }
1213 1246
1214 namespace { 1247 namespace {
1215 1248
1216 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in 1249 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in
1217 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range 1250 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range
1218 // are unique to Chromium. Attributes are matched using a closest fit algorithm. 1251 // are unique to Chromium. Attributes are matched using a closest fit algorithm.
1219 1252
1220 // From <EGL/egl.h>. 1253 // From <EGL/egl.h>.
1221 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE 1254 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE
1222 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE 1255 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1397 }
1365 1398
1366 return true; 1399 return true;
1367 } 1400 }
1368 1401
1369 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" 1402 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
1370 1403
1371 } // namespace gles2 1404 } // namespace gles2
1372 } // namespace gpu 1405 } // namespace gpu
1373 1406
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698