summaryrefslogtreecommitdiffstats
path: root/cc/picture_pile_impl.h
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 19:06:18 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 19:06:18 +0000
commit020909963f5684d47c99bd12a3d3cd246bfe8132 (patch)
tree19ff1275575703bb4bd2ae5d00133bcb4d336bc0 /cc/picture_pile_impl.h
parent212b0e3e8df63c4dcf7b13f997ef3319f6ab6947 (diff)
downloadchromium_src-020909963f5684d47c99bd12a3d3cd246bfe8132.zip
chromium_src-020909963f5684d47c99bd12a3d3cd246bfe8132.tar.gz
chromium_src-020909963f5684d47c99bd12a3d3cd246bfe8132.tar.bz2
cc: Reduce picture cloning by creating at most one clone per raster thread.
This adds raster sequences to the TileManager. Raster tasks posted to the same sequence are guaranteed to run in sequential order, which means only one picture clone per sequence is required. We use the same number of raster sequences as raster threads. BUG=155209 TEST=manual Review URL: https://chromiumcodereview.appspot.com/11419262 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171267 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/picture_pile_impl.h')
-rw-r--r--cc/picture_pile_impl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/cc/picture_pile_impl.h b/cc/picture_pile_impl.h
index 93ac072..b041635 100644
--- a/cc/picture_pile_impl.h
+++ b/cc/picture_pile_impl.h
@@ -5,8 +5,11 @@
#ifndef CC_PICTURE_PILE_IMPL_H_
#define CC_PICTURE_PILE_IMPL_H_
+#include <map>
+
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+#include "base/threading/thread.h"
#include "cc/cc_export.h"
#include "cc/picture.h"
#include "cc/picture_pile.h"
@@ -20,6 +23,9 @@ class CC_EXPORT PicturePileImpl : public base::RefCounted<PicturePileImpl> {
public:
static scoped_refptr<PicturePileImpl> Create();
+ // Get paint-safe version of this picture for a specific thread.
+ PicturePileImpl* GetCloneForDrawingOnThread(base::Thread*);
+
// Clone a paint-safe version of this picture.
scoped_refptr<PicturePileImpl> CloneForDrawing() const;
@@ -40,6 +46,10 @@ private:
PicturePile::Pile pile_;
+ typedef std::map<base::PlatformThreadId, scoped_refptr<PicturePileImpl> >
+ CloneMap;
+ CloneMap clones_;
+
friend class base::RefCounted<PicturePileImpl>;
DISALLOW_COPY_AND_ASSIGN(PicturePileImpl);
};