Chromium Code Reviews| Index: skia/ext/pixel_ref_utils.cc |
| diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc |
| index 49254b18fbcb18833fd63ff24ec0c3f1696ae27c..3d1cbb196ba3bef1893bbc04aab7dd5c4f4b5f16 100644 |
| --- a/skia/ext/pixel_ref_utils.cc |
| +++ b/skia/ext/pixel_ref_utils.cc |
| @@ -100,7 +100,7 @@ class GatherPixelRefDevice : public SkBitmapDevice { |
| if (GetBitmapFromPaint(paint, &bitmap)) { |
| SkRect mapped_rect; |
| draw.fMatrix->mapRect(&mapped_rect, rect); |
| - if (mapped_rect.intersect(SkRect::Make(draw.fRC->getBounds()))) { |
| + if (mapped_rect.intersects(SkRect::Make(draw.fRC->getBounds()))) { |
| AddBitmap(bitmap, mapped_rect, *draw.fMatrix, paint.getFilterQuality()); |
| } |
| } |
| @@ -355,10 +355,8 @@ class GatherPixelRefDevice : public SkBitmapDevice { |
| const SkMatrix& matrix, |
| SkFilterQuality filter_quality) { |
| SkRect canvas_rect = SkRect::MakeWH(width(), height()); |
| - SkRect paint_rect = SkRect::MakeEmpty(); |
| - if (paint_rect.intersect(rect, canvas_rect)) { |
| - pixel_ref_set_->Add(bm.pixelRef(), paint_rect, matrix, |
| - filter_quality); |
| + if (rect.intersects(canvas_rect)) { |
| + pixel_ref_set_->Add(bm.pixelRef(), rect, matrix, filter_quality); |
| } |
| } |
| @@ -385,14 +383,12 @@ void PixelRefUtils::GatherDiscardablePixelRefs( |
| SkRect picture_bounds = picture->cullRect(); |
| SkIRect picture_ibounds = picture_bounds.roundOut(); |
| SkBitmap empty_bitmap; |
| - empty_bitmap.setInfo(SkImageInfo::MakeUnknown(picture_ibounds.width(), |
| - picture_ibounds.height())); |
| + empty_bitmap.setInfo(SkImageInfo::MakeUnknown(picture_ibounds.right(), |
|
reed1
2015/08/10 17:58:38
it might justify a comment here, why we're using r
vmpstr
2015/08/11 21:00:49
Done.
|
| + picture_ibounds.bottom())); |
| GatherPixelRefDevice device(empty_bitmap, &pixel_ref_set); |
| SkNoSaveLayerCanvas canvas(&device); |
| - // Draw the picture pinned against our top/left corner. |
| - canvas.translate(-picture_bounds.left(), -picture_bounds.top()); |
| canvas.drawPicture(picture); |
| } |