diff options
author | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-03 21:46:10 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-03 21:46:10 +0000 |
commit | 1aef2ed83c155509f9c46ee001bfde1eb12cd2e6 (patch) | |
tree | 584ca713c846b273fe36ec2b1b893015edc2d22a /src/pdf/SkPDFDevice.cpp | |
parent | 1962832771a435426a0ed6a1cf5069c45918b141 (diff) |
[PDF] Start from an identity transform for drawDevice.
drawDevice, like drawSprite should start from the identity transform instead of applying the passed translation on top of the current transform.
Review URL: http://codereview.appspot.com/4023066
git-svn-id: http://skia.googlecode.com/svn/trunk@757 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFDevice.cpp')
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index c0224829f5..9ebc0ca6d7 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -440,18 +440,21 @@ void SkPDFDevice::drawDevice(const SkDraw& d, SkDevice* device, int x, int y, SkDevice::drawDevice(d, device, x, y, paint); return; } - // Assume that a vector capable device means that it's a PDF Device. // TODO(vandebo) handle the paint (alpha and compositing mode). + SkPDFDevice* pdfDevice = static_cast<SkPDFDevice*>(device); + SkMatrix matrix; matrix.setTranslate(x, y); - SkPDFDevice* pdfDevice = static_cast<SkPDFDevice*>(device); + SkMatrix curTransform = setTransform(matrix); - SkPDFFormXObject* xobject = new SkPDFFormXObject(pdfDevice, matrix); + SkPDFFormXObject* xobject = new SkPDFFormXObject(pdfDevice); fXObjectResources.push(xobject); // Transfer reference. fContent.append("/X"); fContent.appendS32(fXObjectResources.count() - 1); fContent.append(" Do\n"); + + setTransform(curTransform); } const SkRefPtr<SkPDFDict>& SkPDFDevice::getResourceDict() { |