From 991db24d1532eed736d55eb1d3a1b08783d363ca Mon Sep 17 00:00:00 2001 From: "vmpstr@chromium.org" Date: Thu, 25 Apr 2013 19:11:57 +0000 Subject: 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 --- cc/test/fake_content_layer_client.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cc/test/fake_content_layer_client.cc') 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 -- cgit v1.1