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

Unified Diff: cc/picture.h

Issue 11293188: cc: Make Picture/PicturePile handle recording/raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android_dbg Created 8 years, 1 month 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/picture.cc » ('j') | cc/picture.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture.h
diff --git a/cc/picture.h b/cc/picture.h
index 86a2dd81589dcbef44be20e42f48bf401b16790d..540d5e784d264a299a38e255fb194aaaf4201d59 100644
--- a/cc/picture.h
+++ b/cc/picture.h
@@ -14,25 +14,38 @@
namespace cc {
class ContentLayerClient;
+struct RenderingStats;
class CC_EXPORT Picture
: public base::RefCountedThreadSafe<Picture> {
public:
- scoped_refptr<Picture> create(ContentLayerClient*, gfx::Rect);
+ static scoped_refptr<Picture> Create();
- const gfx::Rect& rect();
- scoped_refptr<Picture> clone();
+ const gfx::Rect& LayerRect() const { return layer_rect_; }
+ const gfx::Rect& OpaqueRect() const { return opaque_rect_; }
-protected:
+ // Make a thread-safe clone for rasterizing with.
+ scoped_refptr<Picture> Clone();
+
+ // Record a paint operation (clobbering any previous recording).
+ void Record(ContentLayerClient*, gfx::Rect layer_rect, RenderingStats&);
+
+ // Raster this Picture's layer_rect into the given canvas.
+ // Assumes contentsScale have already been applied.
+ void Raster(SkCanvas* canvas);
+
+private:
Picture();
+ // This constructor assumes SkPicture is already ref'd and transfers
+ // ownership to this picture.
+ Picture(SkPicture*, gfx::Rect layer_rect, gfx::Rect opaque_rect);
~Picture();
- gfx::Rect m_rect;
- SkPicture m_picture;
+ gfx::Rect layer_rect_;
+ gfx::Rect opaque_rect_;
+ SkAutoTUnref<SkPicture> picture_;
-private:
friend class base::RefCountedThreadSafe<Picture>;
-
DISALLOW_COPY_AND_ASSIGN(Picture);
};
« no previous file with comments | « no previous file | cc/picture.cc » ('j') | cc/picture.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698