| 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_vector.h" | 10 #include "cc/base/scoped_ptr_vector.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback, | 205 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback, |
| 206 unsigned source_buffer, | 206 unsigned source_buffer, |
| 207 unsigned query, | 207 unsigned query, |
| 208 uint8_t* dest_pixels, | 208 uint8_t* dest_pixels, |
| 209 gfx::Size size); | 209 gfx::Size size); |
| 210 void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap, | 210 void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap, |
| 211 scoped_ptr<SkAutoLockPixels> lock, | 211 scoped_ptr<SkAutoLockPixels> lock, |
| 212 scoped_ptr<CopyOutputRequest> request, | 212 scoped_ptr<CopyOutputRequest> request, |
| 213 bool success); | 213 bool success); |
| 214 | 214 |
| 215 static void DeleteTextureReleaseCallback( | |
| 216 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | |
| 217 base::WeakPtr<GLRenderer> gl_renderer, | |
| 218 unsigned texture_id, | |
| 219 unsigned sync_point, | |
| 220 bool lost_resource); | |
| 221 void DeleteTextureReleaseCallbackOnImplThread(unsigned texture_id, | |
| 222 unsigned sync_point, | |
| 223 bool lost_resource); | |
| 224 | |
| 225 void ReinitializeGrCanvas(); | 215 void ReinitializeGrCanvas(); |
| 226 void ReinitializeGLState(); | 216 void ReinitializeGLState(); |
| 227 | 217 |
| 228 virtual void DiscardBackbuffer() OVERRIDE; | 218 virtual void DiscardBackbuffer() OVERRIDE; |
| 229 virtual void EnsureBackbuffer() OVERRIDE; | 219 virtual void EnsureBackbuffer() OVERRIDE; |
| 230 void EnforceMemoryPolicy(); | 220 void EnforceMemoryPolicy(); |
| 231 | 221 |
| 232 RendererCapabilities capabilities_; | 222 RendererCapabilities capabilities_; |
| 233 | 223 |
| 234 unsigned offscreen_framebuffer_id_; | 224 unsigned offscreen_framebuffer_id_; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 struct PendingAsyncReadPixels; | 442 struct PendingAsyncReadPixels; |
| 453 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; | 443 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; |
| 454 | 444 |
| 455 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; | 445 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
| 456 | 446 |
| 457 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; | 447 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; |
| 458 | 448 |
| 459 SkBitmap on_demand_tile_raster_bitmap_; | 449 SkBitmap on_demand_tile_raster_bitmap_; |
| 460 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; | 450 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; |
| 461 | 451 |
| 462 base::WeakPtrFactory<GLRenderer> weak_factory_; | |
| 463 | |
| 464 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 452 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 465 }; | 453 }; |
| 466 | 454 |
| 467 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 455 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
| 468 // call made by the compositor. Useful for debugging rendering issues but | 456 // call made by the compositor. Useful for debugging rendering issues but |
| 469 // will significantly degrade performance. | 457 // will significantly degrade performance. |
| 470 #define DEBUG_GL_CALLS 0 | 458 #define DEBUG_GL_CALLS 0 |
| 471 | 459 |
| 472 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 460 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 473 #define GLC(context, x) \ | 461 #define GLC(context, x) \ |
| 474 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 462 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
| 475 #else | 463 #else |
| 476 #define GLC(context, x) (x) | 464 #define GLC(context, x) (x) |
| 477 #endif | 465 #endif |
| 478 | 466 |
| 479 } // namespace cc | 467 } // namespace cc |
| 480 | 468 |
| 481 #endif // CC_OUTPUT_GL_RENDERER_H_ | 469 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |