summaryrefslogtreecommitdiffstats
path: root/cc/picture_pile_impl.cc
diff options
context:
space:
mode:
authorreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 23:26:52 +0000
committerreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 23:26:52 +0000
commitfb5450649445a173d72dc4390dc0a92c4c7b1064 (patch)
tree43c361e7f5c345e5a3a2f4df04003392a6188119 /cc/picture_pile_impl.cc
parent2f8fdf17994ad5750a85aaa5bdfa2aadde893a01 (diff)
downloadchromium_src-fb5450649445a173d72dc4390dc0a92c4c7b1064.zip
chromium_src-fb5450649445a173d72dc4390dc0a92c4c7b1064.tar.gz
chromium_src-fb5450649445a173d72dc4390dc0a92c4c7b1064.tar.bz2
Re-land: 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://codereview.chromium.org/11419262 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171349 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/picture_pile_impl.cc')
-rw-r--r--cc/picture_pile_impl.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/picture_pile_impl.cc b/cc/picture_pile_impl.cc
index 530a97e..f8e56cc 100644
--- a/cc/picture_pile_impl.cc
+++ b/cc/picture_pile_impl.cc
@@ -20,6 +20,19 @@ PicturePileImpl::PicturePileImpl() {
PicturePileImpl::~PicturePileImpl() {
}
+PicturePileImpl* PicturePileImpl::GetCloneForDrawingOnThread(
+ base::Thread* thread) {
+ // Do we have a clone for this thread yet?
+ CloneMap::iterator it = clones_.find(thread->thread_id());
+ if (it != clones_.end())
+ return it->second;
+
+ // Create clone for this thread.
+ scoped_refptr<PicturePileImpl> clone = CloneForDrawing();
+ clones_[thread->thread_id()] = clone;
+ return clone;
+}
+
scoped_refptr<PicturePileImpl> PicturePileImpl::CloneForDrawing() const {
TRACE_EVENT0("cc", "PicturePileImpl::CloneForDrawing");
scoped_refptr<PicturePileImpl> clone = Create();