From 293a758929222b6003678c6a49bfbb2f2f806e8e Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Fri, 16 Mar 2012 19:50:37 +0000 Subject: [PDF] Fix shaders when the initial transform has a translation. Fixes chromium bug 115041 Review URL: https://codereview.appspot.com/5849045 git-svn-id: http://skia.googlecode.com/svn/trunk@3420 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/pdf/SkPDFDevice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.3