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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1604031: Translate a few OpenGL ES values to OpenGL values. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder.cc (revision 44337)
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc (working copy)
@@ -35,6 +35,17 @@
#define GL_DEPTH24_STENCIL8 0x88F0
#endif
+#if defined(UNIT_TEST)
+
+// OpenGL constants not defined in OpenGL ES 2.0 needed when compiling
+// unit tests. For native OpenGL ES 2.0 backend tese are not used. For OpenGL
Ken Russell (switch to Gerrit) 2010/04/13 16:46:05 tese -> these
+// backend these must be defined by the system.
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+
+#endif
+
namespace gpu {
namespace gles2 {
@@ -1848,26 +1859,31 @@
DCHECK(params);
DCHECK(num_written);
switch (pname) {
+#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2)
case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
*num_written = 1;
- *params = GL_RGB; // TODO(gman): get correct format.
+ *params = GL_RGBA; // TODO(gman): get correct format.
return true;
case GL_IMPLEMENTATION_COLOR_READ_TYPE:
*num_written = 1;
*params = GL_UNSIGNED_BYTE; // TODO(gman): get correct type.
return true;
case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
+ glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, params);
*num_written = 1;
- *params = 16; // TODO(gman): get correct value.
+ *params /= 4;
return true;
case GL_MAX_VARYING_VECTORS:
+ glGetIntegerv(GL_MAX_VARYING_FLOATS, params);
*num_written = 1;
- *params = 8; // TODO(gman): get correct value.
+ *params /= 4;
return true;
case GL_MAX_VERTEX_UNIFORM_VECTORS:
+ glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, params);
*num_written = 1;
- *params = 128; // TODO(gman): get correct value.
+ *params /= 4;
return true;
+#endif
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
*num_written = 1;
*params = 0; // We don't support compressed textures.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698