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

Unified Diff: cc/picture.h

Issue 11265046: cc: Add some impl-side painting stub classes and APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « cc/cc.gyp ('k') | cc/picture.cc » ('j') | no next file with comments »
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
new file mode 100644
index 0000000000000000000000000000000000000000..0adf4657e7fb643dbb112ac3f4dd6269be50fbd7
--- /dev/null
+++ b/cc/picture.h
@@ -0,0 +1,51 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_PICTURE_H_
+#define CC_PICTURE_H_
+
+#include "base/basictypes.h"
+#include "cc/cc_export.h"
+#include "cc/picture_record.h"
+#include "cc/scoped_ptr_vector.h"
+#include "ui/gfx/rect.h"
+#include "ui/gfx/size.h"
+
+namespace cc {
+
+class CC_EXPORT Picture {
+public:
+ Picture();
+ ~Picture();
+
+ // Mark a portion of the Picture as invalid and needing to be re-recorded
+ // the next time update is called.
+ void invalidate(gfx::Rect);
+
+ // Resize the Picture, invalidating / dropping recorded pictures as necessary.
+ void resize(gfx::Size);
+
+ // Rerecord parts of the picture that are invalid.
+ void update(ContentLayerClient* painter);
+
+ // Update other with a shallow copy of this (main => compositor thread commit)
+ void pushPropertiesTo(Picture& other);
+
+ // Clone a paint-safe version of this picture (with cloned PictureRecords)
nduca 2012/11/08 00:49:35 lets add this method later when we wrap our head a
+ scoped_ptr<Picture> cloneForDrawing(gfx::Rect rect);
+
+ // Raster a subrect of this Picture into the given canvas.
+ // It's only safe to call paint on a cloned version.
+ void paint(SkCanvas* canvas, gfx::Rect rect);
+
+protected:
+ std::vector<scoped_refptr<PictureRecord> > pile_;
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(Picture);
+};
+
+} // namespace cc
+
+#endif // CC_PICTURE_H_
« no previous file with comments | « cc/cc.gyp ('k') | cc/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698