aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/pdf/SkPDFDevice.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index e7b24338d2..cf23e6dbdf 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1408,6 +1408,14 @@ 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();
+
+ // 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);
+
pdfShader = SkPDFShader::GetPDFShader(*shader, transform, bounds);
SkSafeUnref(pdfShader.get()); // getShader and SkRefPtr both took a ref