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

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: remove unused function 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 return true;
1226 default:
1227 return false;
1228 }
1229 }
1213 1230
1214 namespace { 1231 namespace {
1215 1232
1216 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in 1233 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in
1217 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range 1234 // 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. 1235 // are unique to Chromium. Attributes are matched using a closest fit algorithm.
1219 1236
1220 // From <EGL/egl.h>. 1237 // From <EGL/egl.h>.
1221 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE 1238 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE
1222 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE 1239 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 } 1381 }
1365 1382
1366 return true; 1383 return true;
1367 } 1384 }
1368 1385
1369 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" 1386 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
1370 1387
1371 } // namespace gles2 1388 } // namespace gles2
1372 } // namespace gpu 1389 } // namespace gpu
1373 1390
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698