Index: cc/output/gl_renderer.h |
diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h |
index b05d02b7ced1f22970aa9b4abe51920950f58acf..adf7920603af5fa21b68af99e349c7c34292ed71 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,8 @@ class CC_EXPORT GLRenderer |
return shared_geometry_.get(); |
} |
+ void GetFramebufferPixelsAsync(gfx::Rect rect, |
+ CopyRenderPassCallback callback); |
bool GetFramebufferTexture(ScopedResource* resource, gfx::Rect device_rect); |
void ReleaseRenderPassTextures(); |
@@ -103,8 +109,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 +186,23 @@ 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, |
+ uint8_t* dest_pixels, |
+ gfx::Size size); |
+ void PassOnSkBitmap( |
+ scoped_ptr<SkBitmap> bitmap, |
+ scoped_ptr<SkAutoLockPixels> lock, |
+ const CopyRenderPassCallback& callback, |
+ bool success); |
+ |
// WebKit:: |
// WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM |
// implementation. |
@@ -378,6 +402,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_; |