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

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: 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/layers/tiled_layer_unittest.cc ('k') | cc/output/gl_renderer.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 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 27 matching lines...) Expand all
38 WebKit::WebGraphicsContext3D:: 38 WebKit::WebGraphicsContext3D::
39 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), 39 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM),
40 public NON_EXPORTED_BASE( 40 public NON_EXPORTED_BASE(
41 WebKit::WebGraphicsContext3D:: 41 WebKit::WebGraphicsContext3D::
42 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM), 42 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM),
43 public NON_EXPORTED_BASE( 43 public NON_EXPORTED_BASE(
44 WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) { 44 WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) {
45 public: 45 public:
46 static scoped_ptr<GLRenderer> Create(RendererClient* client, 46 static scoped_ptr<GLRenderer> Create(RendererClient* client,
47 OutputSurface* output_surface, 47 OutputSurface* output_surface,
48 ResourceProvider* resource_provider); 48 ResourceProvider* resource_provider,
49 int highp_threshold_min);
49 50
50 virtual ~GLRenderer(); 51 virtual ~GLRenderer();
51 52
52 virtual const RendererCapabilities& Capabilities() const OVERRIDE; 53 virtual const RendererCapabilities& Capabilities() const OVERRIDE;
53 54
54 WebKit::WebGraphicsContext3D* Context(); 55 WebKit::WebGraphicsContext3D* Context();
55 56
56 virtual void ViewportChanged() OVERRIDE; 57 virtual void ViewportChanged() OVERRIDE;
57 58
58 virtual void ReceiveCompositorFrameAck(const CompositorFrameAck& ack) 59 virtual void ReceiveCompositorFrameAck(const CompositorFrameAck& ack)
(...skipping 17 matching lines...) Expand all
76 size_t bytes_allocated) OVERRIDE; 77 size_t bytes_allocated) OVERRIDE;
77 78
78 static void DebugGLCall(WebKit::WebGraphicsContext3D* context, 79 static void DebugGLCall(WebKit::WebGraphicsContext3D* context,
79 const char* command, 80 const char* command,
80 const char* file, 81 const char* file,
81 int line); 82 int line);
82 83
83 protected: 84 protected:
84 GLRenderer(RendererClient* client, 85 GLRenderer(RendererClient* client,
85 OutputSurface* output_surface, 86 OutputSurface* output_surface,
86 ResourceProvider* resource_provider); 87 ResourceProvider* resource_provider,
88 int highp_threshold_min);
87 89
88 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } 90 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; }
89 bool Initialize(); 91 bool Initialize();
90 92
91 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } 93 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; }
92 const GeometryBinding* SharedGeometry() const { 94 const GeometryBinding* SharedGeometry() const {
93 return shared_geometry_.get(); 95 return shared_geometry_.get();
94 } 96 }
95 97
96 bool GetFramebufferTexture(ScopedResource* resource, gfx::Rect device_rect); 98 bool GetFramebufferTexture(ScopedResource* resource, gfx::Rect device_rect);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 SolidColorProgramAA; 276 SolidColorProgramAA;
275 277
276 const TileProgram* GetTileProgram(); 278 const TileProgram* GetTileProgram();
277 const TileProgramOpaque* GetTileProgramOpaque(); 279 const TileProgramOpaque* GetTileProgramOpaque();
278 const TileProgramAA* GetTileProgramAA(); 280 const TileProgramAA* GetTileProgramAA();
279 const TileProgramSwizzle* GetTileProgramSwizzle(); 281 const TileProgramSwizzle* GetTileProgramSwizzle();
280 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(); 282 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque();
281 const TileProgramSwizzleAA* GetTileProgramSwizzleAA(); 283 const TileProgramSwizzleAA* GetTileProgramSwizzleAA();
282 const TileCheckerboardProgram* GetTileCheckerboardProgram(); 284 const TileCheckerboardProgram* GetTileCheckerboardProgram();
283 285
284 const RenderPassProgram* GetRenderPassProgram(); 286 const RenderPassProgram* GetRenderPassProgram(
285 const RenderPassProgramAA* GetRenderPassProgramAA(); 287 TexCoordPrecision precision);
286 const RenderPassMaskProgram* GetRenderPassMaskProgram(); 288 const RenderPassProgramAA* GetRenderPassProgramAA(
287 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(); 289 TexCoordPrecision precision);
288 const RenderPassColorMatrixProgram* GetRenderPassColorMatrixProgram(); 290 const RenderPassMaskProgram* GetRenderPassMaskProgram(
289 const RenderPassColorMatrixProgramAA* GetRenderPassColorMatrixProgramAA(); 291 TexCoordPrecision precision);
290 const RenderPassMaskColorMatrixProgram* GetRenderPassMaskColorMatrixProgram(); 292 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA(
293 TexCoordPrecision precision);
294 const RenderPassColorMatrixProgram* GetRenderPassColorMatrixProgram(
295 TexCoordPrecision precision);
296 const RenderPassColorMatrixProgramAA* GetRenderPassColorMatrixProgramAA(
297 TexCoordPrecision precision);
298 const RenderPassMaskColorMatrixProgram* GetRenderPassMaskColorMatrixProgram(
299 TexCoordPrecision precision);
291 const RenderPassMaskColorMatrixProgramAA* 300 const RenderPassMaskColorMatrixProgramAA*
292 GetRenderPassMaskColorMatrixProgramAA(); 301 GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision);
293 302
294 const TextureProgram* GetTextureProgram(); 303 const TextureProgram* GetTextureProgram(
295 const TextureProgramFlip* GetTextureProgramFlip(); 304 TexCoordPrecision precision);
296 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(); 305 const TextureProgramFlip* GetTextureProgramFlip(
306 TexCoordPrecision precision);
307 const TextureIOSurfaceProgram* GetTextureIOSurfaceProgram(
308 TexCoordPrecision precision);
297 309
298 const VideoYUVProgram* GetVideoYUVProgram(); 310 const VideoYUVProgram* GetVideoYUVProgram(
299 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(); 311 TexCoordPrecision precision);
312 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(
313 TexCoordPrecision precision);
300 314
301 const DebugBorderProgram* GetDebugBorderProgram(); 315 const DebugBorderProgram* GetDebugBorderProgram();
302 const SolidColorProgram* GetSolidColorProgram(); 316 const SolidColorProgram* GetSolidColorProgram();
303 const SolidColorProgramAA* GetSolidColorProgramAA(); 317 const SolidColorProgramAA* GetSolidColorProgramAA();
304 318
305 scoped_ptr<TileProgram> tile_program_; 319 scoped_ptr<TileProgram> tile_program_;
306 scoped_ptr<TileProgramOpaque> tile_program_opaque_; 320 scoped_ptr<TileProgramOpaque> tile_program_opaque_;
307 scoped_ptr<TileProgramAA> tile_program_aa_; 321 scoped_ptr<TileProgramAA> tile_program_aa_;
308 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_; 322 scoped_ptr<TileProgramSwizzle> tile_program_swizzle_;
309 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_; 323 scoped_ptr<TileProgramSwizzleOpaque> tile_program_swizzle_opaque_;
310 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_; 324 scoped_ptr<TileProgramSwizzleAA> tile_program_swizzle_aa_;
311 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_; 325 scoped_ptr<TileCheckerboardProgram> tile_checkerboard_program_;
312 326
313 scoped_ptr<TextureProgram> texture_program_; 327 scoped_ptr<TextureProgram> texture_program_;
314 scoped_ptr<TextureProgramFlip> texture_program_flip_; 328 scoped_ptr<TextureProgramFlip> texture_program_flip_;
315 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_; 329 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_;
316 330
331 scoped_ptr<TextureProgram> texture_program_highp_;
332 scoped_ptr<TextureProgramFlip> texture_program_flip_highp_;
333 scoped_ptr<TextureIOSurfaceProgram> texture_io_surface_program_highp_;
334
317 scoped_ptr<RenderPassProgram> render_pass_program_; 335 scoped_ptr<RenderPassProgram> render_pass_program_;
318 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_; 336 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_;
319 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_; 337 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_;
320 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_; 338 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_;
321 scoped_ptr<RenderPassColorMatrixProgram> render_pass_color_matrix_program_; 339 scoped_ptr<RenderPassColorMatrixProgram> render_pass_color_matrix_program_;
322 scoped_ptr<RenderPassColorMatrixProgramAA> 340 scoped_ptr<RenderPassColorMatrixProgramAA>
323 render_pass_color_matrix_program_aa_; 341 render_pass_color_matrix_program_aa_;
324 scoped_ptr<RenderPassMaskColorMatrixProgram> 342 scoped_ptr<RenderPassMaskColorMatrixProgram>
325 render_pass_mask_color_matrix_program_; 343 render_pass_mask_color_matrix_program_;
326 scoped_ptr<RenderPassMaskColorMatrixProgramAA> 344 scoped_ptr<RenderPassMaskColorMatrixProgramAA>
327 render_pass_mask_color_matrix_program_aa_; 345 render_pass_mask_color_matrix_program_aa_;
328 346
347 scoped_ptr<RenderPassProgram> render_pass_program_highp_;
348 scoped_ptr<RenderPassProgramAA> render_pass_program_aa_highp_;
349 scoped_ptr<RenderPassMaskProgram> render_pass_mask_program_highp_;
350 scoped_ptr<RenderPassMaskProgramAA> render_pass_mask_program_aa_highp_;
351 scoped_ptr<RenderPassColorMatrixProgram>
352 render_pass_color_matrix_program_highp_;
353 scoped_ptr<RenderPassColorMatrixProgramAA>
354 render_pass_color_matrix_program_aa_highp_;
355 scoped_ptr<RenderPassMaskColorMatrixProgram>
356 render_pass_mask_color_matrix_program_highp_;
357 scoped_ptr<RenderPassMaskColorMatrixProgramAA>
358 render_pass_mask_color_matrix_program_aa_highp_;
359
329 scoped_ptr<VideoYUVProgram> video_yuv_program_; 360 scoped_ptr<VideoYUVProgram> video_yuv_program_;
330 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_; 361 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_;
331 362
363 scoped_ptr<VideoYUVProgram> video_yuv_program_highp_;
364 scoped_ptr<VideoStreamTextureProgram> video_stream_texture_program_highp_;
365
332 scoped_ptr<DebugBorderProgram> debug_border_program_; 366 scoped_ptr<DebugBorderProgram> debug_border_program_;
333 scoped_ptr<SolidColorProgram> solid_color_program_; 367 scoped_ptr<SolidColorProgram> solid_color_program_;
334 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_; 368 scoped_ptr<SolidColorProgramAA> solid_color_program_aa_;
335 369
336 OutputSurface* output_surface_; 370 OutputSurface* output_surface_;
337 WebKit::WebGraphicsContext3D* context_; 371 WebKit::WebGraphicsContext3D* context_;
338 372
339 gfx::Rect swap_buffer_rect_; 373 gfx::Rect swap_buffer_rect_;
340 gfx::Rect scissor_rect_; 374 gfx::Rect scissor_rect_;
341 bool is_viewport_changed_; 375 bool is_viewport_changed_;
342 bool is_backbuffer_discarded_; 376 bool is_backbuffer_discarded_;
343 bool discard_backbuffer_when_not_visible_; 377 bool discard_backbuffer_when_not_visible_;
344 bool is_using_bind_uniform_; 378 bool is_using_bind_uniform_;
345 bool visible_; 379 bool visible_;
346 bool is_scissor_enabled_; 380 bool is_scissor_enabled_;
347 bool blend_shadow_; 381 bool blend_shadow_;
348 unsigned program_shadow_; 382 unsigned program_shadow_;
349 TexturedQuadDrawCache draw_cache_; 383 TexturedQuadDrawCache draw_cache_;
384 int highp_threshold_min_;
350 385
351 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; 386 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_;
352 387
353 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; 388 scoped_refptr<ResourceProvider::Fence> last_swap_fence_;
354 389
355 SkBitmap on_demand_tile_raster_bitmap_; 390 SkBitmap on_demand_tile_raster_bitmap_;
356 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; 391 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_;
357 392
358 DISALLOW_COPY_AND_ASSIGN(GLRenderer); 393 DISALLOW_COPY_AND_ASSIGN(GLRenderer);
359 }; 394 };
360 395
361 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL 396 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL
362 // call made by the compositor. Useful for debugging rendering issues but 397 // call made by the compositor. Useful for debugging rendering issues but
363 // will significantly degrade performance. 398 // will significantly degrade performance.
364 #define DEBUG_GL_CALLS 0 399 #define DEBUG_GL_CALLS 0
365 400
366 #if DEBUG_GL_CALLS && !defined(NDEBUG) 401 #if DEBUG_GL_CALLS && !defined(NDEBUG)
367 #define GLC(context, x) \ 402 #define GLC(context, x) \
368 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) 403 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__))
369 #else 404 #else
370 #define GLC(context, x) (x) 405 #define GLC(context, x) (x)
371 #endif 406 #endif
372 407
373 } // namespace cc 408 } // namespace cc
374 409
375 #endif // CC_OUTPUT_GL_RENDERER_H_ 410 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer_unittest.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698