| 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 "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/base/scoped_ptr_deque.h" | 10 #include "cc/base/scoped_ptr_deque.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 private: | 136 private: |
| 137 friend class GLRendererShaderPixelTest; | 137 friend class GLRendererShaderPixelTest; |
| 138 friend class GLRendererShaderTest; | 138 friend class GLRendererShaderTest; |
| 139 | 139 |
| 140 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); | 140 static void ToGLMatrix(float* gl_matrix, const gfx::Transform& transform); |
| 141 | 141 |
| 142 void DrawCheckerboardQuad(const DrawingFrame* frame, | 142 void DrawCheckerboardQuad(const DrawingFrame* frame, |
| 143 const CheckerboardDrawQuad* quad); | 143 const CheckerboardDrawQuad* quad); |
| 144 void DrawDebugBorderQuad(const DrawingFrame* frame, | 144 void DrawDebugBorderQuad(const DrawingFrame* frame, |
| 145 const DebugBorderDrawQuad* quad); | 145 const DebugBorderDrawQuad* quad); |
| 146 static bool ShouldApplyBlendModeUsingBlendFunc(const DrawQuad* quad); | 146 static bool IsDefaultBlendMode(SkXfermode::Mode blend_mode) { |
| 147 void ApplyBlendModeUsingBlendFunc(const DrawQuad* quad); | 147 return blend_mode == SkXfermode::kSrcOver_Mode; |
| 148 void RestoreBlendFuncToDefault(); | 148 } |
| 149 bool CanApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode); |
| 150 void ApplyBlendModeUsingBlendFunc(SkXfermode::Mode blend_mode); |
| 151 void RestoreBlendFuncToDefault(SkXfermode::Mode blend_mode); |
| 149 scoped_ptr<ScopedResource> GetBackgroundWithFilters( | 152 scoped_ptr<ScopedResource> GetBackgroundWithFilters( |
| 150 DrawingFrame* frame, | 153 DrawingFrame* frame, |
| 151 const RenderPassDrawQuad* quad, | 154 const RenderPassDrawQuad* quad, |
| 152 const gfx::Transform& contents_device_transform, | 155 const gfx::Transform& contents_device_transform, |
| 153 const gfx::Transform& contents_device_transformInverse, | 156 const gfx::Transform& contents_device_transformInverse, |
| 154 bool* background_changed); | 157 bool* background_changed); |
| 155 void DrawRenderPassQuad(DrawingFrame* frame, const RenderPassDrawQuad* quad); | 158 void DrawRenderPassQuad(DrawingFrame* frame, const RenderPassDrawQuad* quad); |
| 156 void DrawSolidColorQuad(const DrawingFrame* frame, | 159 void DrawSolidColorQuad(const DrawingFrame* frame, |
| 157 const SolidColorDrawQuad* quad); | 160 const SolidColorDrawQuad* quad); |
| 158 void DrawStreamVideoQuad(const DrawingFrame* frame, | 161 void DrawStreamVideoQuad(const DrawingFrame* frame, |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 struct PendingAsyncReadPixels; | 417 struct PendingAsyncReadPixels; |
| 415 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; | 418 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; |
| 416 | 419 |
| 417 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; | 420 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
| 418 | 421 |
| 419 class SyncQuery; | 422 class SyncQuery; |
| 420 ScopedPtrDeque<SyncQuery> pending_sync_queries_; | 423 ScopedPtrDeque<SyncQuery> pending_sync_queries_; |
| 421 ScopedPtrDeque<SyncQuery> available_sync_queries_; | 424 ScopedPtrDeque<SyncQuery> available_sync_queries_; |
| 422 scoped_ptr<SyncQuery> current_sync_query_; | 425 scoped_ptr<SyncQuery> current_sync_query_; |
| 423 bool use_sync_query_; | 426 bool use_sync_query_; |
| 427 bool use_blend_minmax; |
| 424 | 428 |
| 425 SkBitmap on_demand_tile_raster_bitmap_; | 429 SkBitmap on_demand_tile_raster_bitmap_; |
| 426 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; | 430 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; |
| 427 | 431 |
| 428 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 432 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 429 }; | 433 }; |
| 430 | 434 |
| 431 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 435 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
| 432 // call made by the compositor. Useful for debugging rendering issues but | 436 // call made by the compositor. Useful for debugging rendering issues but |
| 433 // will significantly degrade performance. | 437 // will significantly degrade performance. |
| 434 #define DEBUG_GL_CALLS 0 | 438 #define DEBUG_GL_CALLS 0 |
| 435 | 439 |
| 436 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 440 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 437 #define GLC(context, x) \ | 441 #define GLC(context, x) \ |
| 438 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 442 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
| 439 #else | 443 #else |
| 440 #define GLC(context, x) (x) | 444 #define GLC(context, x) (x) |
| 441 #endif | 445 #endif |
| 442 | 446 |
| 443 } // namespace cc | 447 } // namespace cc |
| 444 | 448 |
| 445 #endif // CC_OUTPUT_GL_RENDERER_H_ | 449 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |