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

Side by Side Diff: cc/output/gl_renderer.h

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: Cleanup highp shaders 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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 #ifndef CC_OUTPUT_GL_RENDERER_H_ 5 #ifndef CC_OUTPUT_GL_RENDERER_H_
6 #define CC_OUTPUT_GL_RENDERER_H_ 6 #define CC_OUTPUT_GL_RENDERER_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/output/direct_renderer.h" 9 #include "cc/output/direct_renderer.h"
10 #include "cc/output/gl_renderer_draw_cache.h" 10 #include "cc/output/gl_renderer_draw_cache.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // Render surface shaders. 222 // Render surface shaders.
223 typedef ProgramBinding<VertexShaderPosTexTransform, 223 typedef ProgramBinding<VertexShaderPosTexTransform,
224 FragmentShaderRGBATexAlpha> RenderPassProgram; 224 FragmentShaderRGBATexAlpha> RenderPassProgram;
225 typedef ProgramBinding<VertexShaderPosTexTransform, 225 typedef ProgramBinding<VertexShaderPosTexTransform,
226 FragmentShaderRGBATexAlphaMask> RenderPassMaskProgram; 226 FragmentShaderRGBATexAlphaMask> RenderPassMaskProgram;
227 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaAA> 227 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaAA>
228 RenderPassProgramAA; 228 RenderPassProgramAA;
229 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaMaskAA> 229 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaMaskAA>
230 RenderPassMaskProgramAA; 230 RenderPassMaskProgramAA;
231 231
232 typedef ProgramBinding<VertexShaderPosTexTransform,
vangelis 2013/03/20 19:20:44 I don't believe the highp typedefs are needed. The
brianderson 2013/03/20 20:57:15 Ah yes, these are not needed and are not used. I u
233 FragmentShaderRGBATexAlpha> RenderPassProgramHighP;
234 typedef ProgramBinding<VertexShaderPosTexTransform,
235 FragmentShaderRGBATexAlphaMask> RenderPassMaskProgramHi ghP;
236 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaAA>
237 RenderPassProgramAAHighP;
238 typedef ProgramBinding<VertexShaderQuad, FragmentShaderRGBATexAlphaMaskAA>
239 RenderPassMaskProgramAAHighP;
240
232 // Texture shaders. 241 // Texture shaders.
233 typedef ProgramBinding<VertexShaderPosTexTransform, 242 typedef ProgramBinding<VertexShaderPosTexTransform,
234 FragmentShaderRGBATexVaryingAlpha> TextureProgram; 243 FragmentShaderRGBATexVaryingAlpha> TextureProgram;
235 typedef ProgramBinding<VertexShaderPosTexTransformFlip, 244 typedef ProgramBinding<VertexShaderPosTexTransformFlip,
236 FragmentShaderRGBATexVaryingAlpha> TextureProgramFlip; 245 FragmentShaderRGBATexVaryingAlpha> TextureProgramFlip;
237 typedef ProgramBinding<VertexShaderPosTexTransform, 246 typedef ProgramBinding<VertexShaderPosTexTransform,
238 FragmentShaderRGBATexRectVaryingAlpha> 247 FragmentShaderRGBATexRectVaryingAlpha>
239 TextureIOSurfaceProgram; 248 TextureIOSurfaceProgram;
240 249
250 typedef ProgramBinding<VertexShaderPosTexTransform,
251 FragmentShaderRGBATexVaryingAlpha> TextureProgramHighP;
252 typedef ProgramBinding<VertexShaderPosTexTransformFlip,
253 FragmentShaderRGBATexVaryingAlpha> TextureProgramFlipHi ghP;
254 typedef ProgramBinding<VertexShaderPosTexTransform,
255 FragmentShaderRGBATexRectVaryingAlpha>
256 TextureIOSurfaceProgramHighP;
257
241 // Video shaders. 258 // Video shaders.
242 typedef ProgramBinding<VertexShaderVideoTransform, 259 typedef ProgramBinding<VertexShaderVideoTransform,
243 FragmentShaderOESImageExternal> 260 FragmentShaderOESImageExternal>
244 VideoStreamTextureProgram; 261 VideoStreamTextureProgram;
245 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo> 262 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo>
246 VideoYUVProgram; 263 VideoYUVProgram;
247 264
265 typedef ProgramBinding<VertexShaderVideoTransform,
266 FragmentShaderOESImageExternal>
267 VideoStreamTextureProgramHighP;
268 typedef ProgramBinding<VertexShaderPosTexYUVStretch, FragmentShaderYUVVideo>
269 VideoYUVProgramHighP;
270
248 // Special purpose / effects shaders. 271 // Special purpose / effects shaders.
249 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor> 272 typedef ProgramBinding<VertexShaderPos, FragmentShaderColor>
250 DebugBorderProgram; 273 DebugBorderProgram;
251 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor> 274 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColor>
252 SolidColorProgram; 275 SolidColorProgram;
253 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColorAA> 276 typedef ProgramBinding<VertexShaderQuad, FragmentShaderColorAA>
254 SolidColorProgramAA; 277 SolidColorProgramAA;
255 278
256 const TileProgram* GetTileProgram(); 279 const TileProgram* GetTileProgram();
257 const TileProgramOpaque* GetTileProgramOpaque(); 280 const TileProgramOpaque* GetTileProgramOpaque();
258 const TileProgramAA* GetTileProgramAA(); 281 const TileProgramAA* GetTileProgramAA();
259 const TileProgramSwizzle* GetTileProgramSwizzle(); 282 const TileProgramSwizzle* GetTileProgramSwizzle();
260 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(); 283 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque();
261 const TileProgramSwizzleAA* GetTileProgramSwizzleAA(); 284 const TileProgramSwizzleAA* GetTileProgramSwizzleAA();
262 const TileCheckerboardProgram* GetTileCheckerboardProgram(); 285 const TileCheckerboardProgram* GetTileCheckerboardProgram();
263 286
264 const RenderPassProgram* GetRenderPassProgram(); 287 const RenderPassProgram* GetRenderPassProgram(
265 const RenderPassProgramAA* GetRenderPassProgramAA(); 288 TexCoordPrecision precision);
266 const RenderPassMaskProgram* GetRenderPassMaskProgram(); 289 const RenderPassProgramAA* GetRenderPassProgramAA(
267 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(); 290 TexCoordPrecision precision);
291 const RenderPassMaskProgram* GetRenderPassMaskProgram(
292 TexCoordPrecision precision);
293 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(
294 TexCoordPrecision precision);
268 295
269 const TextureProgram* GetTextureProgram(); 296 const TextureProgram* GetTextureProgram(
270 const TextureProgramFlip* GetTextureProgramFlip(); 297 TexCoordPrecision precision);
271 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(); 298 const TextureProgramFlip* GetTextureProgramFlip(
299 TexCoordPrecision precision);
300 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(
301 TexCoordPrecision precision);
272 302
273 const VideoYUVProgram* GetVideoYUVProgram(); 303 const VideoYUVProgram* GetVideoYUVProgram(
274 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(); 304 TexCoordPrecision precision);
305 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(
306 TexCoordPrecision precision);
275 307
276 const DebugBorderProgram* GetDebugBorderProgram(); 308 const DebugBorderProgram* GetDebugBorderProgram();
277 const SolidColorProgram* GetSolidColorProgram(); 309 const SolidColorProgram* GetSolidColorProgram();
278 const SolidColorProgramAA* GetSolidColorProgramAA(); 310 const SolidColorProgramAA* GetSolidColorProgramAA();
279 311
280 scoped_ptr<TileProgram> tile_program_; 312 scoped_ptr<TileProgram> tile_program_;
281 scoped_ptr<TileProgramOpaque> tile_program_opaque_; 313 scoped_ptr<TileProgramOpaque> tile_program_opaque_;
282 scoped_ptr<TileProgramAA> tile_program_aa_; 314 scoped_ptr<TileProgramAA> tile_program_aa_;
283 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_; 315 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_;
284 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_; 316 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_;
285 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_; 317 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_;
286 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_; 318 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_;
287 319
288 scoped_ptr<RenderPassProgram> render_pass_program_; 320 scoped_ptr<RenderPassProgram> render_pass_program_;
289 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_; 321 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_;
290 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_; 322 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_;
291 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_; 323 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_;
292 324
325 scoped_ptr<RenderPassProgram> render_pass_program_highp_;
326 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_highp_;
327 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_highp_;
328 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_highp_;
329
293 scoped_ptr<TextureProgram> texture_program_; 330 scoped_ptr<TextureProgram> texture_program_;
294 scoped_ptr<TextureProgramFlip> texture_program_flip_; 331 scoped_ptr<TextureProgramFlip> texture_program_flip_;
295 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_; 332 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_;
296 333
334 scoped_ptr<TextureProgram> texture_program_highp_;
335 scoped_ptr<TextureProgramFlip> texture_program_flip_highp_;
336 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_highp_;
337
297 scoped_ptr<VideoYUVProgram> video_yuv_program_; 338 scoped_ptr<VideoYUVProgram> video_yuv_program_;
298 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_; 339 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_;
299 340
341 scoped_ptr<VideoYUVProgram> video_yuv_program_highp_;
342 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_highp_;
343
300 scoped_ptr<DebugBorderProgram> debug_border_program_; 344 scoped_ptr<DebugBorderProgram> debug_border_program_;
301 scoped_ptr<SolidColorProgram> solid_color_program_; 345 scoped_ptr<SolidColorProgram> solid_color_program_;
302 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; 346 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_;
303 347
304 OutputSurface* output_surface_; 348 OutputSurface* output_surface_;
305 WebKit::WebGraphicsContext3D* context_; 349 WebKit::WebGraphicsContext3D* context_;
306 350
307 gfx::Rect swap_buffer_rect_; 351 gfx::Rect swap_buffer_rect_;
308 gfx::Rect scissor_rect_; 352 gfx::Rect scissor_rect_;
309 bool is_viewport_changed_; 353 bool is_viewport_changed_;
(...skipping 21 matching lines...) Expand all
331 #if DEBUG_GL_CALLS && !defined(NDEBUG) 375 #if DEBUG_GL_CALLS && !defined(NDEBUG)
332 #define GLC(context, x) \ 376 #define GLC(context, x) \
333 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) 377 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__))
334 #else 378 #else
335 #define GLC(context, x) (x) 379 #define GLC(context, x) (x)
336 #endif 380 #endif
337 381
338 } 382 }
339 383
340 #endif // CC_OUTPUT_GL_RENDERER_H_ 384 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698