OLD | NEW |
---|---|
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" |
11 #include "cc/output/renderer.h" | 11 #include "cc/output/renderer.h" |
12 #include "cc/quads/checkerboard_draw_quad.h" | 12 #include "cc/quads/checkerboard_draw_quad.h" |
13 #include "cc/quads/debug_border_draw_quad.h" | 13 #include "cc/quads/debug_border_draw_quad.h" |
14 #include "cc/quads/io_surface_draw_quad.h" | 14 #include "cc/quads/io_surface_draw_quad.h" |
15 #include "cc/quads/render_pass_draw_quad.h" | 15 #include "cc/quads/render_pass_draw_quad.h" |
16 #include "cc/quads/solid_color_draw_quad.h" | 16 #include "cc/quads/solid_color_draw_quad.h" |
17 #include "cc/quads/tile_draw_quad.h" | 17 #include "cc/quads/tile_draw_quad.h" |
18 #include "cc/quads/yuv_video_draw_quad.h" | 18 #include "cc/quads/yuv_video_draw_quad.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" |
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAl location.h" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAl location.h" |
21 #include "ui/gfx/quad_f.h" | 21 #include "ui/gfx/quad_f.h" |
22 | 22 |
23 namespace cc { | 23 namespace cc { |
24 | 24 |
25 class GLRendererShaderTest; | 25 class GLRendererShaderTest; |
26 class OutputSurface; | 26 class OutputSurface; |
27 class PictureDrawQuad; | |
27 class ScopedResource; | 28 class ScopedResource; |
28 class StreamVideoDrawQuad; | 29 class StreamVideoDrawQuad; |
29 class TextureDrawQuad; | 30 class TextureDrawQuad; |
30 class GeometryBinding; | 31 class GeometryBinding; |
31 class ScopedEnsureFramebufferAllocation; | 32 class ScopedEnsureFramebufferAllocation; |
32 | 33 |
33 // Class that handles drawing of composited render layers using GL. | 34 // Class that handles drawing of composited render layers using GL. |
34 class CC_EXPORT GLRenderer : | 35 class CC_EXPORT GLRenderer : |
35 public DirectRenderer, | 36 public DirectRenderer, |
36 public NON_EXPORTED_BASE( | 37 public NON_EXPORTED_BASE( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 void DrawSolidColorQuad(const DrawingFrame& frame, | 131 void DrawSolidColorQuad(const DrawingFrame& frame, |
131 const SolidColorDrawQuad* quad); | 132 const SolidColorDrawQuad* quad); |
132 void DrawStreamVideoQuad(const DrawingFrame& frame, | 133 void DrawStreamVideoQuad(const DrawingFrame& frame, |
133 const StreamVideoDrawQuad* quad); | 134 const StreamVideoDrawQuad* quad); |
134 void DrawTextureQuad(const DrawingFrame& frame, const TextureDrawQuad* quad); | 135 void DrawTextureQuad(const DrawingFrame& frame, const TextureDrawQuad* quad); |
135 void EnqueueTextureQuad(const DrawingFrame& frame, | 136 void EnqueueTextureQuad(const DrawingFrame& frame, |
136 const TextureDrawQuad* quad); | 137 const TextureDrawQuad* quad); |
137 void FlushTextureQuadCache(); | 138 void FlushTextureQuadCache(); |
138 void DrawIOSurfaceQuad(const DrawingFrame& frame, | 139 void DrawIOSurfaceQuad(const DrawingFrame& frame, |
139 const IOSurfaceDrawQuad* quad); | 140 const IOSurfaceDrawQuad* quad); |
140 void DrawTileQuad(const DrawingFrame& frame, const TileDrawQuad* quad); | 141 void DrawTileQuad(const DrawingFrame& frame, |
142 const TileDrawQuadBase* quad, | |
143 unsigned resource_id); | |
danakj
2013/03/21 02:34:42
ResourceProvider::ResourceId is the type
Leandro GraciĆ” Gil
2013/03/21 16:42:48
Done.
| |
141 void DrawYUVVideoQuad(const DrawingFrame& frame, | 144 void DrawYUVVideoQuad(const DrawingFrame& frame, |
142 const YUVVideoDrawQuad* quad); | 145 const YUVVideoDrawQuad* quad); |
146 void DrawPictureQuad(const DrawingFrame& frame, const PictureDrawQuad* quad); | |
143 | 147 |
144 void SetShaderOpacity(float opacity, int alpha_location); | 148 void SetShaderOpacity(float opacity, int alpha_location); |
145 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); | 149 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); |
146 void DrawQuadGeometry(const DrawingFrame& frame, | 150 void DrawQuadGeometry(const DrawingFrame& frame, |
147 const gfx::Transform& draw_transform, | 151 const gfx::Transform& draw_transform, |
148 const gfx::RectF& quad_rect, | 152 const gfx::RectF& quad_rect, |
149 int matrix_location); | 153 int matrix_location); |
150 void SetBlendEnabled(bool enabled); | 154 void SetBlendEnabled(bool enabled); |
151 void SetUseProgram(unsigned program); | 155 void SetUseProgram(unsigned program); |
152 | 156 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 bool visible_; | 317 bool visible_; |
314 bool is_scissor_enabled_; | 318 bool is_scissor_enabled_; |
315 bool blend_shadow_; | 319 bool blend_shadow_; |
316 unsigned program_shadow_; | 320 unsigned program_shadow_; |
317 TexturedQuadDrawCache draw_cache_; | 321 TexturedQuadDrawCache draw_cache_; |
318 | 322 |
319 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; | 323 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
320 | 324 |
321 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; | 325 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; |
322 | 326 |
327 SkBitmap on_demand_tile_raster_bitmap_; | |
328 GLuint on_demand_tile_raster_texture_; | |
329 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; | |
330 | |
323 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 331 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
324 }; | 332 }; |
325 | 333 |
326 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 334 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
327 // call made by the compositor. Useful for debugging rendering issues but | 335 // call made by the compositor. Useful for debugging rendering issues but |
328 // will significantly degrade performance. | 336 // will significantly degrade performance. |
329 #define DEBUG_GL_CALLS 0 | 337 #define DEBUG_GL_CALLS 0 |
330 | 338 |
331 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 339 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
332 #define GLC(context, x) \ | 340 #define GLC(context, x) \ |
333 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) | 341 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) |
334 #else | 342 #else |
335 #define GLC(context, x) (x) | 343 #define GLC(context, x) (x) |
336 #endif | 344 #endif |
337 | 345 |
338 } | 346 } |
339 | 347 |
340 #endif // CC_OUTPUT_GL_RENDERER_H_ | 348 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |