| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } | 86 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } |
| 87 bool Initialize(); | 87 bool Initialize(); |
| 88 | 88 |
| 89 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } | 89 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } |
| 90 const GeometryBinding* SharedGeometry() const { | 90 const GeometryBinding* SharedGeometry() const { |
| 91 return shared_geometry_.get(); | 91 return shared_geometry_.get(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void GetFramebufferPixelsAsync(gfx::Rect rect, | 94 void GetFramebufferPixelsAsync(gfx::Rect rect, |
| 95 bool flipped_y, |
| 95 CopyRenderPassCallback callback); | 96 CopyRenderPassCallback callback); |
| 96 bool GetFramebufferTexture(ScopedResource* resource, gfx::Rect device_rect); | 97 bool GetFramebufferTexture(ScopedResource* resource, gfx::Rect device_rect); |
| 97 void ReleaseRenderPassTextures(); | 98 void ReleaseRenderPassTextures(); |
| 98 | 99 |
| 99 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) OVERRIDE; | 100 virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) OVERRIDE; |
| 100 virtual bool BindFramebufferToTexture(DrawingFrame* frame, | 101 virtual bool BindFramebufferToTexture(DrawingFrame* frame, |
| 101 const ScopedResource* resource, | 102 const ScopedResource* resource, |
| 102 gfx::Rect framebuffer_rect) OVERRIDE; | 103 gfx::Rect framebuffer_rect) OVERRIDE; |
| 103 virtual void SetDrawViewportSize(gfx::Size viewport_size) OVERRIDE; | 104 virtual void SetDrawViewportSize(gfx::Size viewport_size) OVERRIDE; |
| 104 virtual void SetScissorTestRect(gfx::Rect scissor_rect) OVERRIDE; | 105 virtual void SetScissorTestRect(gfx::Rect scissor_rect) OVERRIDE; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 bool MakeContextCurrent(); | 185 bool MakeContextCurrent(); |
| 185 | 186 |
| 186 bool InitializeSharedObjects(); | 187 bool InitializeSharedObjects(); |
| 187 void CleanupSharedObjects(); | 188 void CleanupSharedObjects(); |
| 188 | 189 |
| 189 typedef base::Callback<void(bool success)> | 190 typedef base::Callback<void(bool success)> |
| 190 AsyncGetFramebufferPixelsCleanupCallback; | 191 AsyncGetFramebufferPixelsCleanupCallback; |
| 191 void DoGetFramebufferPixels( | 192 void DoGetFramebufferPixels( |
| 192 uint8* pixels, | 193 uint8* pixels, |
| 193 gfx::Rect rect, | 194 gfx::Rect rect, |
| 195 bool flipped_y, |
| 194 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback); | 196 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback); |
| 195 void FinishedReadback( | 197 void FinishedReadback( |
| 196 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback, | 198 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback, |
| 197 unsigned source_buffer, | 199 unsigned source_buffer, |
| 198 uint8_t* dest_pixels, | 200 uint8_t* dest_pixels, |
| 199 gfx::Size size); | 201 gfx::Size size, |
| 202 bool flipped_y); |
| 200 void PassOnSkBitmap( | 203 void PassOnSkBitmap( |
| 201 scoped_ptr<SkBitmap> bitmap, | 204 scoped_ptr<SkBitmap> bitmap, |
| 202 scoped_ptr<SkAutoLockPixels> lock, | 205 scoped_ptr<SkAutoLockPixels> lock, |
| 203 const CopyRenderPassCallback& callback, | 206 const CopyRenderPassCallback& callback, |
| 204 bool success); | 207 bool success); |
| 205 | 208 |
| 206 // WebKit:: | 209 // WebKit:: |
| 207 // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM | 210 // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM |
| 208 // implementation. | 211 // implementation. |
| 209 virtual void onMemoryAllocationChanged( | 212 virtual void onMemoryAllocationChanged( |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 bool blend_shadow_; | 403 bool blend_shadow_; |
| 401 unsigned program_shadow_; | 404 unsigned program_shadow_; |
| 402 TexturedQuadDrawCache draw_cache_; | 405 TexturedQuadDrawCache draw_cache_; |
| 403 int highp_threshold_min_; | 406 int highp_threshold_min_; |
| 404 int highp_threshold_cache_; | 407 int highp_threshold_cache_; |
| 405 | 408 |
| 406 struct PendingAsyncReadPixels; | 409 struct PendingAsyncReadPixels; |
| 407 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; | 410 ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; |
| 408 | 411 |
| 409 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; | 412 scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
| 413 gfx::Size current_framebuffer_size_; |
| 410 | 414 |
| 411 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; | 415 scoped_refptr<ResourceProvider::Fence> last_swap_fence_; |
| 412 | 416 |
| 413 SkBitmap on_demand_tile_raster_bitmap_; | 417 SkBitmap on_demand_tile_raster_bitmap_; |
| 414 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; | 418 ResourceProvider::ResourceId on_demand_tile_raster_resource_id_; |
| 415 | 419 |
| 416 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 420 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 417 }; | 421 }; |
| 418 | 422 |
| 419 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 423 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
| 420 // call made by the compositor. Useful for debugging rendering issues but | 424 // call made by the compositor. Useful for debugging rendering issues but |
| 421 // will significantly degrade performance. | 425 // will significantly degrade performance. |
| 422 #define DEBUG_GL_CALLS 0 | 426 #define DEBUG_GL_CALLS 0 |
| 423 | 427 |
| 424 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 428 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 425 #define GLC(context, x) \ | 429 #define GLC(context, x) \ |
| 426 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 430 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
| 427 #else | 431 #else |
| 428 #define GLC(context, x) (x) | 432 #define GLC(context, x) (x) |
| 429 #endif | 433 #endif |
| 430 | 434 |
| 431 } // namespace cc | 435 } // namespace cc |
| 432 | 436 |
| 433 #endif // CC_OUTPUT_GL_RENDERER_H_ | 437 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |