diff options
author | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-25 19:11:57 +0000 |
---|---|---|
committer | vmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-25 19:11:57 +0000 |
commit | 991db24d1532eed736d55eb1d3a1b08783d363ca (patch) | |
tree | 663b2779fa61cb9750cd30f488611ea4661f6e05 /cc/test/fake_content_layer_client.cc | |
parent | 92ed0e1a885fb97c73002ba1ae847cd4966a980d (diff) | |
download | chromium_src-991db24d1532eed736d55eb1d3a1b08783d363ca.zip chromium_src-991db24d1532eed736d55eb1d3a1b08783d363ca.tar.gz chromium_src-991db24d1532eed736d55eb1d3a1b08783d363ca.tar.bz2 |
cc: Do GatherPixelRefs from skia at record time
This change gather lazy pixel refs from skia at record time and
stores them in a 512x512 grid. When GatherPixelRefs is invoked,
the refs are looked up in this grid (cells that intersect our
required rect contribute their pixel refs to the final result)
BUG=231977
Review URL: https://chromiumcodereview.appspot.com/14230007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_content_layer_client.cc')
-rw-r--r-- | cc/test/fake_content_layer_client.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc index 7153766..280459b 100644 --- a/cc/test/fake_content_layer_client.cc +++ b/cc/test/fake_content_layer_client.cc @@ -5,6 +5,7 @@ #include "cc/test/fake_content_layer_client.h" #include "third_party/skia/include/core/SkCanvas.h" +#include "ui/gfx/skia_util.h" namespace cc { @@ -20,10 +21,11 @@ void FakeContentLayerClient::PaintContents(SkCanvas* canvas, if (paint_all_opaque_) *opaque_rect = rect; + canvas->clipRect(gfx::RectToSkRect(rect)); for (RectPaintVector::const_iterator it = draw_rects_.begin(); - it < draw_rects_.end(); ++it) { + it != draw_rects_.end(); ++it) { gfx::Rect rect = it->first; - SkPaint paint = it->second; + const SkPaint& paint = it->second; SkRect draw_rect = SkRect::MakeXYWH( rect.x(), rect.y(), @@ -31,6 +33,11 @@ void FakeContentLayerClient::PaintContents(SkCanvas* canvas, rect.height()); canvas->drawRect(draw_rect, paint); } + + for (BitmapVector::const_iterator it = draw_bitmaps_.begin(); + it != draw_bitmaps_.end(); ++it) { + canvas->drawBitmap(it->first, it->second.x(), it->second.y()); + } } } // namespace cc |