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

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: Be conservative on Android 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
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 0f5325586f79dca5554a45ae6df7672664632c17..ec2bbed549e25a785490ef31b31ca507c95c82f9 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,45 @@ 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;
+ case GL_MEDIUM_INT:
+ range[0] = 10;
+ range[1] = 10;
+ *precision = 0;
+ 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;
+ case GL_MEDIUM_FLOAT:
+ range[0] = 14;
+ range[1] = 14;
+ *precision = 10;
+ 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();

Powered by Google App Engine
This is Rietveld 408576698