Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 24130010: [PDF] clear() and drawPaint() where applying the initial transform twice. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 internalDrawPaint(newPaint, content.entry()); 764 internalDrawPaint(newPaint, content.entry());
765 } 765 }
766 766
767 void SkPDFDevice::internalDrawPaint(const SkPaint& paint, 767 void SkPDFDevice::internalDrawPaint(const SkPaint& paint,
768 ContentEntry* contentEntry) { 768 ContentEntry* contentEntry) {
769 if (!contentEntry) { 769 if (!contentEntry) {
770 return; 770 return;
771 } 771 }
772 SkRect bbox = SkRect::MakeWH(SkIntToScalar(this->width()), 772 SkRect bbox = SkRect::MakeWH(SkIntToScalar(this->width()),
773 SkIntToScalar(this->height())); 773 SkIntToScalar(this->height()));
774 SkMatrix totalTransform = fInitialTransform;
775 totalTransform.preConcat(contentEntry->fState.fMatrix);
776 SkMatrix inverse; 774 SkMatrix inverse;
777 if (!totalTransform.invert(&inverse)) { 775 if (!contentEntry->fState.fMatrix.invert(&inverse)) {
778 return; 776 return;
779 } 777 }
780 inverse.mapRect(&bbox); 778 inverse.mapRect(&bbox);
781 779
782 SkPDFUtils::AppendRectangle(bbox, &contentEntry->fContent); 780 SkPDFUtils::AppendRectangle(bbox, &contentEntry->fContent);
783 SkPDFUtils::PaintPath(paint.getStyle(), SkPath::kWinding_FillType, 781 SkPDFUtils::PaintPath(paint.getStyle(), SkPath::kWinding_FillType,
784 &contentEntry->fContent); 782 &contentEntry->fContent);
785 } 783 }
786 784
787 void SkPDFDevice::drawPoints(const SkDraw& d, SkCanvas::PointMode mode, 785 void SkPDFDevice::drawPoints(const SkDraw& d, SkCanvas::PointMode mode,
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 } 1920 }
1923 1921
1924 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, 1922 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
1925 SkCanvas::Config8888) { 1923 SkCanvas::Config8888) {
1926 return false; 1924 return false;
1927 } 1925 }
1928 1926
1929 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { 1927 bool SkPDFDevice::allowImageFilter(SkImageFilter*) {
1930 return false; 1928 return false;
1931 } 1929 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698