Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: cc/layers/layer.h

Issue 14060015: cc: Async readback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.h
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 84119649773f43d3e1decfa18041c772ad49e81e..a35d7a5df308255829ab2c3a62c1c5346756f618 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
#include "cc/animation/layer_animation_controller.h"
@@ -76,6 +77,18 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
const LayerList& children() const { return children_; }
Layer* child_at(size_t index) { return children_[index].get(); }
+ typedef base::Callback<void(scoped_ptr<SkBitmap>)>
+ RequestCopyAsBitmapCallback;
+
+ // This requests the layer and its subtree be rendered into an SkBitmap and
+ // call the given callback when the SkBitmap has been produced. If the copy
+ // is unable to be produced (the layer is destroyed first), then the callback
+ // is called with a NULL bitmap.
+ void RequestCopyAsBitmap(RequestCopyAsBitmapCallback callback);
+ bool HasRequestCopyCallback() const {
+ return !request_copy_callbacks_.empty();
+ }
+
void SetAnchorPoint(gfx::PointF anchor_point);
gfx::PointF anchor_point() const { return anchor_point_; }
@@ -480,6 +493,8 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
gfx::Transform impl_transform_;
+ std::vector<RequestCopyAsBitmapCallback> request_copy_callbacks_;
+
WebKit::WebLayerScrollClient* layer_scroll_client_;
DrawProperties<Layer, RenderSurface> draw_properties_;
« no previous file with comments | « no previous file | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698