summaryrefslogtreecommitdiffstats
path: root/cc/picture_pile.h
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 06:22:35 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 06:22:35 +0000
commitd98c0240810b6164cc46eb62ff670912a4ac28ba (patch)
tree9744ef4a7d07bae5330348f17986883dbeb8ce10 /cc/picture_pile.h
parenta7259fb7e7d3ce696f0f3af91f7672c5ec551668 (diff)
downloadchromium_src-d98c0240810b6164cc46eb62ff670912a4ac28ba.zip
chromium_src-d98c0240810b6164cc46eb62ff670912a4ac28ba.tar.gz
chromium_src-d98c0240810b6164cc46eb62ff670912a4ac28ba.tar.bz2
cc: Add some impl-side painting stub classes and APIs
BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11265046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/picture_pile.h')
-rw-r--r--cc/picture_pile.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/cc/picture_pile.h b/cc/picture_pile.h
new file mode 100644
index 0000000..5d53974
--- /dev/null
+++ b/cc/picture_pile.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_PILE_H_
+#define CC_PICTURE_PILE_H_
+
+#include "base/basictypes.h"
+#include "cc/cc_export.h"
+#include "cc/picture.h"
+#include "cc/scoped_ptr_vector.h"
+#include "ui/gfx/rect.h"
+#include "ui/gfx/size.h"
+
+namespace cc {
+
+class CC_EXPORT PicturePile {
+public:
+ PicturePile();
+ ~PicturePile();
+
+ // Mark a portion of the PicturePile as invalid and needing to be re-recorded
+ // the next time update is called.
+ void invalidate(gfx::Rect);
+
+ // Resize the PicturePile, 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(PicturePile& other);
+
+ // Clone a paint-safe version of this picture (with cloned PicturePileRecords)
+ scoped_ptr<PicturePile> cloneForDrawing(gfx::Rect rect);
+
+ // Raster a subrect of this PicturePile 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<Picture> > pile_;
+ gfx::Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(PicturePile);
+};
+
+} // namespace cc
+
+#endif // CC_PICTURE_PILE_H_