SkPDF: do not use SkRegion in populateGraphicStateEntryFromPaint()

Change-Id: I3eb192426f5b648fe7ad7db3c8dac42771be0197
Reviewed-on: https://skia-review.googlesource.com/8893
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2017-02-22 16:32:34 -05:00 committed by Skia Commit-Bot
parent e2d78ec818
commit a41c2aa338

View File

@ -2005,14 +2005,15 @@ void SkPDFDevice::populateGraphicStateEntryFromPaint(
// PDF doesn't support kClamp_TileMode, so we simulate it by making
// a pattern the size of the current clip.
SkIRect bounds = clipRegion.getBounds();
SkRect clipStackBounds = clipStack.bounds(this->getGlobalBounds());
SkIPoint deviceOrigin = this->getOrigin();
clipStackBounds.offset(-deviceOrigin.x(), -deviceOrigin.y());
// We need to apply the initial transform to bounds in order to get
// bounds in a consistent coordinate system.
SkRect boundsTemp;
boundsTemp.set(bounds);
fInitialTransform.mapRect(&boundsTemp);
boundsTemp.roundOut(&bounds);
fInitialTransform.mapRect(&clipStackBounds);
SkIRect bounds;
clipStackBounds.roundOut(&bounds);
SkScalar rasterScale =
SkIntToScalar(fRasterDpi) / DPI_FOR_RASTER_SCALE_ONE;