diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-07 09:16:34 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-07 09:16:34 +0000 |
commit | 0dd9815a9ae48eef6e8b7d89a1f38916a55f469b (patch) | |
tree | 655f62497248bf16b07f223c5fab2ad4ff3dfb14 /cc/test | |
parent | 37b7206a8c304700fb250a4eba8e22dd038a8b04 (diff) | |
download | chromium_src-0dd9815a9ae48eef6e8b7d89a1f38916a55f469b.zip chromium_src-0dd9815a9ae48eef6e8b7d89a1f38916a55f469b.tar.gz chromium_src-0dd9815a9ae48eef6e8b7d89a1f38916a55f469b.tar.bz2 |
cc: Clear impl-side painting canvases more efficiently
This change pipes the contents opaque flag from the layer to the pile
recording. If this flag is true, the layer promises that it will raster
something opaque covering layer bounds. This lets us avoid a clear for all but
the internal edge texels which need to be cleared for filtering during
rasterization and the external edge texels which need to be cleared for
filtering during drawing.
Any non-opaque layer now just gets cleared to transparent, as that seemed to be
about 4x faster on average than drawing a rect even for rects that didn't cover
the entire canvas.
R=vmpstr@chromium.org
BUG=246782
Review URL: https://chromiumcodereview.appspot.com/16580011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/fake_picture_pile_impl.cc | 2 | ||||
-rw-r--r-- | cc/test/fake_picture_pile_impl.h | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc index 0530cfb..b14a6e9 100644 --- a/cc/test/fake_picture_pile_impl.cc +++ b/cc/test/fake_picture_pile_impl.cc @@ -51,6 +51,8 @@ void FakePicturePileImpl::AddRecordingAt(int x, int y) { if (HasRecordingAt(x, y)) return; gfx::Rect bounds(tiling().TileBounds(x, y)); + bounds.Inset(-buffer_pixels(), -buffer_pixels()); + scoped_refptr<Picture> picture(Picture::Create(bounds)); picture->Record(&client_, tile_grid_info_, NULL); picture->GatherPixelRefs(tile_grid_info_, NULL); diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h index bedc6ce..a606934 100644 --- a/cc/test/fake_picture_pile_impl.h +++ b/cc/test/fake_picture_pile_impl.h @@ -48,6 +48,14 @@ class FakePicturePileImpl : public PicturePileImpl { default_paint_ = paint; } + void set_background_color(SkColor color) { + background_color_ = color; + } + + void set_contents_opaque(bool contents_opaque) { + contents_opaque_ = contents_opaque; + } + protected: FakePicturePileImpl(); virtual ~FakePicturePileImpl(); |