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

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: rebase after all dependencies landed Created 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 break;
168 case GL_MEDIUM_INT:
169 range[0] = 10;
170 range[1] = 10;
171 *precision = 0;
172 break;
173 case GL_HIGH_INT:
174 range[0] = 16;
175 range[1] = 16;
176 *precision = 0;
177 break;
178 case GL_LOW_FLOAT:
179 range[0] = 8;
180 range[1] = 8;
181 *precision = 8;
182 break;
183 case GL_MEDIUM_FLOAT:
184 range[0] = 14;
185 range[1] = 14;
186 *precision = 10;
187 break;
188 case GL_HIGH_FLOAT:
189 range[0] = 62;
190 range[1] = 62;
191 *precision = 16;
192 break;
193 default:
194 NOTREACHED();
195 break;
196 }
197 }
198
155 WebKit::WebString FakeWebGraphicsContext3D::getShaderSource( 199 WebKit::WebString FakeWebGraphicsContext3D::getShaderSource(
156 WebGLId shader) { 200 WebGLId shader) {
157 return WebKit::WebString(); 201 return WebKit::WebString();
158 } 202 }
159 203
160 WebKit::WebString FakeWebGraphicsContext3D::getString(WGC3Denum name) { 204 WebKit::WebString FakeWebGraphicsContext3D::getString(WGC3Denum name) {
161 return WebKit::WebString(); 205 return WebKit::WebString();
162 } 206 }
163 207
164 WebKit::WGC3Dint FakeWebGraphicsContext3D::getUniformLocation( 208 WebKit::WGC3Dint FakeWebGraphicsContext3D::getUniformLocation(
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 334
291 void FakeWebGraphicsContext3D::setContextLostCallback( 335 void FakeWebGraphicsContext3D::setContextLostCallback(
292 WebGraphicsContextLostCallback* callback) { 336 WebGraphicsContextLostCallback* callback) {
293 } 337 }
294 338
295 void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, 339 void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current,
296 WGC3Denum other) { 340 WGC3Denum other) {
297 } 341 }
298 342
299 } // namespace cc 343 } // namespace cc
OLDNEW
« 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