summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-17 02:07:18 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-17 02:07:18 +0000
commit2b65462d60b5aaf92236dc4cf9641e9e9eefb115 (patch)
treeff1c0272779958611fc95c2b4ca8a41554fc3889 /cc
parent3c6ab1df899bdaa1c1874d35f3c5843e1673c132 (diff)
downloadchromium_src-2b65462d60b5aaf92236dc4cf9641e9e9eefb115.zip
chromium_src-2b65462d60b5aaf92236dc4cf9641e9e9eefb115.tar.gz
chromium_src-2b65462d60b5aaf92236dc4cf9641e9e9eefb115.tar.bz2
cc: Use Skia information about whether pictures have bitmaps
This information allows us to early out of functions around gathering and iterating through pixel refs. BUG=316196 Review URL: https://codereview.chromium.org/115273003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/resources/picture.cc2
-rw-r--r--cc/resources/picture.h2
-rw-r--r--cc/resources/picture_pile_impl.cc3
3 files changed, 6 insertions, 1 deletions
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index 7e278f8..8c3be9c 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -248,6 +248,8 @@ void Picture::GatherPixelRefs(
"height", layer_rect_.height());
DCHECK(picture_);
+ if (!WillPlayBackBitmaps())
+ return;
cell_size_ = gfx::Size(
tile_grid_info.fTileInterval.width() +
2 * tile_grid_info.fMargin.width(),
diff --git a/cc/resources/picture.h b/cc/resources/picture.h
index 4eb238a..085fb6a 100644
--- a/cc/resources/picture.h
+++ b/cc/resources/picture.h
@@ -117,6 +117,8 @@ class CC_EXPORT Picture
void EmitTraceSnapshot();
void EmitTraceSnapshotAlias(Picture* original);
+ bool WillPlayBackBitmaps() const { return picture_->willPlayBackBitmaps(); }
+
private:
explicit Picture(gfx::Rect layer_rect);
// This constructor assumes SkPicture is already ref'd and transfers
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index ca160b5..b6f4d77 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -386,7 +386,8 @@ void PicturePileImpl::PixelRefIterator::AdvanceToTilePictureWithPixelRefs() {
continue;
const Picture* picture = it->second.GetPicture();
- if (!picture || (processed_pictures_.count(picture) != 0))
+ if (!picture || (processed_pictures_.count(picture) != 0) ||
+ !picture->WillPlayBackBitmaps())
continue;
processed_pictures_.insert(picture);