| 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_GL_RENDERER_H_ | 5 #ifndef CC_GL_RENDERER_H_ |
| 6 #define CC_GL_RENDERER_H_ | 6 #define CC_GL_RENDERER_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/checkerboard_draw_quad.h" | 9 #include "cc/checkerboard_draw_quad.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| 11 #include "cc/direct_renderer.h" | 11 #include "cc/direct_renderer.h" |
| 12 #include "cc/gl_renderer_draw_cache.h" | 12 #include "cc/gl_renderer_draw_cache.h" |
| 13 #include "cc/io_surface_draw_quad.h" | 13 #include "cc/io_surface_draw_quad.h" |
| 14 #include "cc/render_pass_draw_quad.h" | 14 #include "cc/render_pass_draw_quad.h" |
| 15 #include "cc/renderer.h" | 15 #include "cc/renderer.h" |
| 16 #include "cc/solid_color_draw_quad.h" | 16 #include "cc/solid_color_draw_quad.h" |
| 17 #include "cc/tile_draw_quad.h" | 17 #include "cc/tile_draw_quad.h" |
| 18 #include "cc/yuv_video_draw_quad.h" | 18 #include "cc/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 OutputSurface; | 25 class OutputSurface; |
| 26 class PictureDrawQuad; |
| 26 class ScopedResource; | 27 class ScopedResource; |
| 27 class StreamVideoDrawQuad; | 28 class StreamVideoDrawQuad; |
| 28 class TextureDrawQuad; | 29 class TextureDrawQuad; |
| 29 class GeometryBinding; | 30 class GeometryBinding; |
| 30 class ScopedEnsureFramebufferAllocation; | 31 class ScopedEnsureFramebufferAllocation; |
| 31 | 32 |
| 32 // Class that handles drawing of composited render layers using GL. | 33 // Class that handles drawing of composited render layers using GL. |
| 33 class CC_EXPORT GLRenderer : | 34 class CC_EXPORT GLRenderer : |
| 34 public DirectRenderer, | 35 public DirectRenderer, |
| 35 public NON_EXPORTED_BASE( | 36 public NON_EXPORTED_BASE( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const StreamVideoDrawQuad* quad); | 131 const StreamVideoDrawQuad* quad); |
| 131 void DrawTextureQuad(const DrawingFrame& frame, const TextureDrawQuad* quad); | 132 void DrawTextureQuad(const DrawingFrame& frame, const TextureDrawQuad* quad); |
| 132 void EnqueueTextureQuad(const DrawingFrame& frame, | 133 void EnqueueTextureQuad(const DrawingFrame& frame, |
| 133 const TextureDrawQuad* quad); | 134 const TextureDrawQuad* quad); |
| 134 void FlushTextureQuadCache(); | 135 void FlushTextureQuadCache(); |
| 135 void DrawIOSurfaceQuad(const DrawingFrame& frame, | 136 void DrawIOSurfaceQuad(const DrawingFrame& frame, |
| 136 const IOSurfaceDrawQuad* quad); | 137 const IOSurfaceDrawQuad* quad); |
| 137 void DrawTileQuad(const DrawingFrame& frame, const TileDrawQuad* quad); | 138 void DrawTileQuad(const DrawingFrame& frame, const TileDrawQuad* quad); |
| 138 void DrawYUVVideoQuad(const DrawingFrame& frame, | 139 void DrawYUVVideoQuad(const DrawingFrame& frame, |
| 139 const YUVVideoDrawQuad* quad); | 140 const YUVVideoDrawQuad* quad); |
| 141 void DrawPictureQuad(const DrawingFrame& frame, const PictureDrawQuad* quad); |
| 140 | 142 |
| 141 void SetShaderOpacity(float opacity, int alpha_location); | 143 void SetShaderOpacity(float opacity, int alpha_location); |
| 142 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); | 144 void SetShaderQuadF(const gfx::QuadF& quad, int quad_location); |
| 143 void DrawQuadGeometry(const DrawingFrame& frame, | 145 void DrawQuadGeometry(const DrawingFrame& frame, |
| 144 const gfx::Transform& draw_transform, | 146 const gfx::Transform& draw_transform, |
| 145 const gfx::RectF& quad_rect, | 147 const gfx::RectF& quad_rect, |
| 146 int matrix_location); | 148 int matrix_location); |
| 147 void SetBlendEnabled(bool enabled); | 149 void SetBlendEnabled(bool enabled); |
| 148 void SetUseProgram(unsigned program); | 150 void SetUseProgram(unsigned program); |
| 149 | 151 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 bool visible_; | 293 bool visible_; |
| 292 bool is_scissor_enabled_; | 294 bool is_scissor_enabled_; |
| 293 bool blend_shadow_; | 295 bool blend_shadow_; |
| 294 unsigned program_shadow_; | 296 unsigned program_shadow_; |
| 295 TexturedQuadDrawCache draw_cache_; | 297 TexturedQuadDrawCache draw_cache_; |
| 296 | 298 |
| 297 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; | 299 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
| 298 | 300 |
| 299 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; | 301 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; |
| 300 | 302 |
| 303 SkBitmap on_demand_tile_raster_bitmap_; |
| 304 GLuint on_demand_tile_raster_texture_; |
| 305 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; |
| 306 |
| 301 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 307 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 302 }; | 308 }; |
| 303 | 309 |
| 304 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 310 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
| 305 // call made by the compositor. Useful for debugging rendering issues but | 311 // call made by the compositor. Useful for debugging rendering issues but |
| 306 // will significantly degrade performance. | 312 // will significantly degrade performance. |
| 307 #define DEBUG_GL_CALLS 0 | 313 #define DEBUG_GL_CALLS 0 |
| 308 | 314 |
| 309 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 315 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 310 #define GLC(context, x) \ | 316 #define GLC(context, x) \ |
| 311 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) | 317 (x, GLRenderer::DebugGLCall (&* context, #x, __FILE__, __LINE__)) |
| 312 #else | 318 #else |
| 313 #define GLC(context, x) (x) | 319 #define GLC(context, x) (x) |
| 314 #endif | 320 #endif |
| 315 | 321 |
| 316 } | 322 } |
| 317 | 323 |
| 318 #endif // CC_GL_RENDERER_H_ | 324 #endif // CC_GL_RENDERER_H_ |
| OLD | NEW |