| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, const TileDrawQuad* quad); |
| 142 void DrawContentQuad(const DrawingFrame& frame, |
| 143 const ContentDrawQuadBase* quad, |
| 144 ResourceProvider::ResourceId resource_id); |
| 141 void DrawYUVVideoQuad(const DrawingFrame& frame, | 145 void DrawYUVVideoQuad(const DrawingFrame& frame, |
| 142 const YUVVideoDrawQuad* quad); | 146 const YUVVideoDrawQuad* quad); |
| 147 void DrawPictureQuad(const DrawingFrame& frame, |
| 148 const PictureDrawQuad* quad); |
| 143 | 149 |
| 144 void SetShaderOpacity(float opacity, int alpha_location); | 150 void SetShaderOpacity(float opacity, int alpha_location); |
| 145 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); | 151 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); |
| 146 void DrawQuadGeometry(const DrawingFrame& frame, | 152 void DrawQuadGeometry(const DrawingFrame& frame, |
| 147 const gfx::Transform& draw_transform, | 153 const gfx::Transform& draw_transform, |
| 148 const gfx::RectF& quad_rect, | 154 const gfx::RectF& quad_rect, |
| 149 int matrix_location); | 155 int matrix_location); |
| 150 void SetBlendEnabled(bool enabled); | 156 void SetBlendEnabled(bool enabled); |
| 151 void SetUseProgram(unsigned program); | 157 void SetUseProgram(unsigned program); |
| 152 | 158 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 bool visible_; | 319 bool visible_; |
| 314 bool is_scissor_enabled_; | 320 bool is_scissor_enabled_; |
| 315 bool blend_shadow_; | 321 bool blend_shadow_; |
| 316 unsigned program_shadow_; | 322 unsigned program_shadow_; |
| 317 TexturedQuadDrawCache draw_cache_; | 323 TexturedQuadDrawCache draw_cache_; |
| 318 | 324 |
| 319 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; | 325 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
| 320 | 326 |
| 321 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; | 327 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; |
| 322 | 328 |
| 329 SkBitmap on_demand_tile_raster_bitmap_; |
| 330 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; |
| 331 |
| 323 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 332 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 324 }; | 333 }; |
| 325 | 334 |
| 326 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 335 // 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 | 336 // call made by the compositor. Useful for debugging rendering issues but |
| 328 // will significantly degrade performance. | 337 // will significantly degrade performance. |
| 329 #define DEBUG_GL_CALLS 0 | 338 #define DEBUG_GL_CALLS 0 |
| 330 | 339 |
| 331 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 340 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 332 #define GLC(context, x) \ | 341 #define GLC(context, x) \ |
| 333 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) | 342 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) |
| 334 #else | 343 #else |
| 335 #define GLC(context, x) (x) | 344 #define GLC(context, x) (x) |
| 336 #endif | 345 #endif |
| 337 | 346 |
| 338 } | 347 } |
| 339 | 348 |
| 340 #endif // CC_OUTPUT_GL_RENDERER_H_ | 349 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |