diff options
author | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-16 19:50:37 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-16 19:50:37 +0000 |
commit | 293a758929222b6003678c6a49bfbb2f2f806e8e (patch) | |
tree | 9fadce97018acc93d570f2da4eb2ced595e1fd16 | |
parent | ce47fec10ccda45550625221c64322d89622c707 (diff) |
[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
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 8 |
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 |