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 324adbdf78112ab4662655e6c17d9af0ae5425b8..2886bb6780849214f039d2fb42f0f7ecd0a7aa35 100644 |
| --- a/skia/ext/pixel_ref_utils.cc |
| +++ b/skia/ext/pixel_ref_utils.cc |
| @@ -351,15 +351,17 @@ void PixelRefUtils::GatherDiscardablePixelRefs( |
| pixel_refs->clear(); |
| DiscardablePixelRefSet pixel_ref_set(pixel_refs); |
| + SkRect picture_bounds = picture->cullRect(); |
| + SkIRect picture_ibounds = picture_bounds.roundOut(); |
| SkBitmap empty_bitmap; |
| - empty_bitmap.setInfo(SkImageInfo::MakeUnknown(picture->width(), picture->height())); |
| + empty_bitmap.setInfo(SkImageInfo::MakeUnknown(picture_ibounds.width(), |
| + picture_ibounds.height())); |
| GatherPixelRefDevice device(empty_bitmap, &pixel_ref_set); |
| SkNoSaveLayerCanvas canvas(&device); |
| - canvas.clipRect(SkRect::MakeWH(picture->width(), picture->height()), |
| - SkRegion::kIntersect_Op, |
| - false); |
| + // want to draw the picture pinned against our top/left corner |
|
danakj
2014/12/12 18:53:53
comments should get capital letters and periods
reed1
2014/12/12 19:12:02
Done.
|
| + canvas.translate(-picture_bounds.left(), -picture_bounds.top()); |
| canvas.drawPicture(picture); |
| } |