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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "cc/debug/fake_web_graphics_context_3d.h" 5 #include "cc/debug/fake_web_graphics_context_3d.h"
6 6
7 #include "base/logging.h"
7 #include "third_party/khronos/GLES2/gl2.h" 8 #include "third_party/khronos/GLES2/gl2.h"
8 9
9 using WebKit::WGC3Dboolean; 10 using WebKit::WGC3Dboolean;
10 using WebKit::WGC3Denum; 11 using WebKit::WGC3Denum;
11 using WebKit::WebGLId; 12 using WebKit::WebGLId;
12 using WebKit::WebGraphicsContext3D; 13 using WebKit::WebGraphicsContext3D;
13 14
14 namespace cc { 15 namespace cc {
15 16
16 FakeWebGraphicsContext3D::FakeWebGraphicsContext3D() 17 FakeWebGraphicsContext3D::FakeWebGraphicsContext3D()
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 WebKit::WGC3Dint* value) { 146 WebKit::WGC3Dint* value) {
146 if (pname == GL_COMPILE_STATUS) 147 if (pname == GL_COMPILE_STATUS)
147 *value = 1; 148 *value = 1;
148 } 149 }
149 150
150 WebKit::WebString FakeWebGraphicsContext3D::getShaderInfoLog( 151 WebKit::WebString FakeWebGraphicsContext3D::getShaderInfoLog(
151 WebGLId shader) { 152 WebGLId shader) {
152 return WebKit::WebString(); 153 return WebKit::WebString();
153 } 154 }
154 155
156 void FakeWebGraphicsContext3D::getShaderPrecisionFormat(
157 WebKit::WGC3Denum shadertype,
158 WebKit::WGC3Denum precisiontype,
159 WebKit::WGC3Dint* range,
160 WebKit::WGC3Dint* precision) {
161 // Return the minimum precision requirements of the GLES specificatin.
162 switch (precisiontype) {
163 case GL_LOW_INT:
164 range[0] = 8;
165 range[1] = 8;
166 *precision = 0;
167 case GL_MEDIUM_INT:
168 range[0] = 10;
169 range[1] = 10;
170 *precision = 0;
171 case GL_HIGH_INT:
172 range[0] = 16;
173 range[1] = 16;
174 *precision = 0;
175 break;
176 case GL_LOW_FLOAT:
177 range[0] = 8;
178 range[1] = 8;
179 *precision = 8;
180 case GL_MEDIUM_FLOAT:
181 range[0] = 14;
182 range[1] = 14;
183 *precision = 10;
184 case GL_HIGH_FLOAT:
185 range[0] = 62;
186 range[1] = 62;
187 *precision = 16;
188 break;
189 default:
190 NOTREACHED();
191 break;
192 }
193 }
194
155 WebKit::WebString FakeWebGraphicsContext3D::getShaderSource( 195 WebKit::WebString FakeWebGraphicsContext3D::getShaderSource(
156 WebGLId shader) { 196 WebGLId shader) {
157 return WebKit::WebString(); 197 return WebKit::WebString();
158 } 198 }
159 199
160 WebKit::WebString FakeWebGraphicsContext3D::getString(WGC3Denum name) { 200 WebKit::WebString FakeWebGraphicsContext3D::getString(WGC3Denum name) {
161 return WebKit::WebString(); 201 return WebKit::WebString();
162 } 202 }
163 203
164 WebKit::WGC3Dint FakeWebGraphicsContext3D::getUniformLocation( 204 WebKit::WGC3Dint FakeWebGraphicsContext3D::getUniformLocation(
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 330
291 void FakeWebGraphicsContext3D::setContextLostCallback( 331 void FakeWebGraphicsContext3D::setContextLostCallback(
292 WebGraphicsContextLostCallback* callback) { 332 WebGraphicsContextLostCallback* callback) {
293 } 333 }
294 334
295 void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, 335 void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current,
296 WGC3Denum other) { 336 WGC3Denum other) {
297 } 337 }
298 338
299 } // namespace cc 339 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698