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

Unified Diff: cc/debug/fake_web_graphics_context_3d.cc

Issue 12665005: cc: Use highp precision for texture coords if available and needed (Closed) Base URL: http://git.chromium.org/chromium/src.git@highp2
Patch Set: rebase after all dependencies landed Created 7 years, 9 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 | « cc/debug/fake_web_graphics_context_3d.h ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/fake_web_graphics_context_3d.cc
diff --git a/cc/debug/fake_web_graphics_context_3d.cc b/cc/debug/fake_web_graphics_context_3d.cc
index c626eb11d2269ea3e6e6edc66715c82d58d4a455..d3ab18a3c4f96e23f64343b5616623ea9aa9b474 100644
--- a/cc/debug/fake_web_graphics_context_3d.cc
+++ b/cc/debug/fake_web_graphics_context_3d.cc
@@ -4,6 +4,7 @@
#include "cc/debug/fake_web_graphics_context_3d.h"
+#include "base/logging.h"
#include "third_party/khronos/GLES2/gl2.h"
using WebKit::WGC3Dboolean;
@@ -152,6 +153,49 @@ WebKit::WebString FakeWebGraphicsContext3D::getShaderInfoLog(
return WebKit::WebString();
}
+void FakeWebGraphicsContext3D::getShaderPrecisionFormat(
+ WebKit::WGC3Denum shadertype,
+ WebKit::WGC3Denum precisiontype,
+ WebKit::WGC3Dint* range,
+ WebKit::WGC3Dint* precision) {
+ // Return the minimum precision requirements of the GLES specificatin.
+ switch (precisiontype) {
+ case GL_LOW_INT:
+ range[0] = 8;
+ range[1] = 8;
+ *precision = 0;
+ break;
+ case GL_MEDIUM_INT:
+ range[0] = 10;
+ range[1] = 10;
+ *precision = 0;
+ break;
+ case GL_HIGH_INT:
+ range[0] = 16;
+ range[1] = 16;
+ *precision = 0;
+ break;
+ case GL_LOW_FLOAT:
+ range[0] = 8;
+ range[1] = 8;
+ *precision = 8;
+ break;
+ case GL_MEDIUM_FLOAT:
+ range[0] = 14;
+ range[1] = 14;
+ *precision = 10;
+ break;
+ case GL_HIGH_FLOAT:
+ range[0] = 62;
+ range[1] = 62;
+ *precision = 16;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+}
+
WebKit::WebString FakeWebGraphicsContext3D::getShaderSource(
WebGLId shader) {
return WebKit::WebString();
« no previous file with comments | « cc/debug/fake_web_graphics_context_3d.h ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698