Index: skia/ext/pixel_ref_utils.cc |
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc |
index fa5f29984948e93b54e86dc441ee84f272a88c1d..6283f12d5d3d29b5e534ec40b7fddc9d5a2db633 100644 |
--- a/skia/ext/pixel_ref_utils.cc |
+++ b/skia/ext/pixel_ref_utils.cc |
@@ -99,7 +99,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()); |
} |
} |
@@ -341,10 +341,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); |
} |
} |
@@ -371,14 +369,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(), |
weiliangc
2015/08/07 22:56:00
Just to double check, this won't need more memory
vmpstr
2015/08/10 17:36:05
It shouldn't, since we don't allocate any memory f
|
+ 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); |
} |