typedef SkBaseDevice INHERITED;
};
-SkData* SkPictureUtils::GatherPixelRefs(SkPicture* pict, const SkRect& area) {
+SkData* SkPictureUtils::GatherPixelRefs(const SkPicture* pict, const SkRect& area) {
if (NULL == pict) {
return NULL;
}
// this test also handles if either area or pict's width/height are empty
- if (!SkRect::Intersects(area,
- SkRect::MakeWH(SkIntToScalar(pict->width()),
- SkIntToScalar(pict->height())))) {
+ if (!SkRect::Intersects(area, pict->cullRect())) {
return NULL;
}
SkTDArray<SkPixelRef*> array;
PixelRefSet prset(&array);
- GatherPixelRefDevice device(pict->width(), pict->height(), &prset);
+ GatherPixelRefDevice device(SkScalarCeilToInt(pict->cullRect().width()),
+ SkScalarCeilToInt(pict->cullRect().height()),
+ &prset);
SkNoSaveLayerCanvas canvas(&device);
canvas.clipRect(area, SkRegion::kIntersect_Op, false);