Chromium Code Reviews| Index: cc/output/gl_renderer.h |
| diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h |
| index b05d02b7ced1f22970aa9b4abe51920950f58acf..5afd795873595d767719bed75a22f631d4306f4f 100644 |
| --- a/cc/output/gl_renderer.h |
| +++ b/cc/output/gl_renderer.h |
| @@ -5,7 +5,9 @@ |
| #ifndef CC_OUTPUT_GL_RENDERER_H_ |
| #define CC_OUTPUT_GL_RENDERER_H_ |
| +#include "base/cancelable_callback.h" |
| #include "cc/base/cc_export.h" |
| +#include "cc/base/scoped_ptr_vector.h" |
| #include "cc/output/direct_renderer.h" |
| #include "cc/output/gl_renderer_draw_cache.h" |
| #include "cc/output/renderer.h" |
| @@ -20,6 +22,8 @@ |
| #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsMemoryAllocation.h" |
| #include "ui/gfx/quad_f.h" |
| +class SkBitmap; |
| + |
| namespace cc { |
| class GLRendererShaderTest; |
| @@ -87,6 +91,7 @@ class CC_EXPORT GLRenderer |
| return shared_geometry_.get(); |
| } |
| + void GetFramebufferPixels(gfx::Rect rect, CopyRenderPassCallback callback); |
|
piman
2013/04/27 00:42:25
nit: can we avoid overloading? Especially if one i
danakj
2013/04/29 14:59:05
Oh gosh, yes you're right. Renamed back to GetFram
|
| bool GetFramebufferTexture(ScopedResource* resource, gfx::Rect device_rect); |
| void ReleaseRenderPassTextures(); |
| @@ -103,8 +108,9 @@ class CC_EXPORT GLRenderer |
| virtual bool FlippedFramebuffer() const OVERRIDE; |
| virtual void EnsureScissorTestEnabled() OVERRIDE; |
| virtual void EnsureScissorTestDisabled() OVERRIDE; |
| - virtual void CopyCurrentRenderPassToBitmap(DrawingFrame* frame, |
| - SkBitmap* bitmap) OVERRIDE; |
| + virtual void CopyCurrentRenderPassToBitmap( |
| + DrawingFrame* frame, |
| + const CopyRenderPassCallback& callback) OVERRIDE; |
| virtual void FinishDrawingQuadList() OVERRIDE; |
| private: |
| @@ -179,6 +185,25 @@ class CC_EXPORT GLRenderer |
| bool InitializeSharedObjects(); |
| void CleanupSharedObjects(); |
| + typedef base::Callback<void(bool success)> |
| + AsyncGetFramebufferPixelsCleanupCallback; |
| + void DoGetFramebufferPixels( |
| + uint8* pixels, |
| + gfx::Rect rect, |
| + const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback); |
| + void FinishedReadback( |
| + const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback, |
| + unsigned source_buffer, |
| + scoped_ptr<uint8[]> sync_pixels, |
| + uint8_t* dest_pixels, |
| + gfx::Size size, |
| + unsigned sync_point); |
| + void PassOnSkBitmap( |
| + scoped_ptr<SkBitmap> bitmap, |
| + scoped_ptr<SkAutoLockPixels> lock, |
| + const CopyRenderPassCallback& callback, |
| + bool success); |
| + |
| // WebKit:: |
| // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM |
| // implementation. |
| @@ -378,6 +403,9 @@ class CC_EXPORT GLRenderer |
| TexturedQuadDrawCache draw_cache_; |
| int highp_threshold_min_; |
| + struct PendingAsyncReadPixels; |
| + ScopedPtrVector<PendingAsyncReadPixels> pending_async_read_pixels_; |
| + |
| scoped_ptr<ResourceProvider::ScopedWriteLockGL> current_framebuffer_lock_; |
| scoped_refptr<ResourceProvider::Fence> last_swap_fence_; |