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

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

Issue 24811002: Update the SkDocument interface to allow for 1) abort won't emit pdf, 2) close can report success/f… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix typo Created 7 years, 2 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 | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFDeviceFlattener.h » ('j') | 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 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 } 2027 }
2028 return resourceIndex; 2028 return resourceIndex;
2029 } 2029 }
2030 2030
2031 void SkPDFDevice::internalDrawBitmap(const SkMatrix& matrix, 2031 void SkPDFDevice::internalDrawBitmap(const SkMatrix& matrix,
2032 const SkClipStack* clipStack, 2032 const SkClipStack* clipStack,
2033 const SkRegion& clipRegion, 2033 const SkRegion& clipRegion,
2034 const SkBitmap& bitmap, 2034 const SkBitmap& bitmap,
2035 const SkIRect* srcRect, 2035 const SkIRect* srcRect,
2036 const SkPaint& paint) { 2036 const SkPaint& paint) {
2037 // TODO(edisonn): Perspective matrix support implemented here
2037 SkMatrix scaled; 2038 SkMatrix scaled;
2038 // Adjust for origin flip. 2039 // Adjust for origin flip.
2039 scaled.setScale(SK_Scalar1, -SK_Scalar1); 2040 scaled.setScale(SK_Scalar1, -SK_Scalar1);
2040 scaled.postTranslate(0, SK_Scalar1); 2041 scaled.postTranslate(0, SK_Scalar1);
2041 // Scale the image up from 1x1 to WxH. 2042 // Scale the image up from 1x1 to WxH.
2042 SkIRect subset = SkIRect::MakeWH(bitmap.width(), bitmap.height()); 2043 SkIRect subset = SkIRect::MakeWH(bitmap.width(), bitmap.height());
2043 scaled.postScale(SkIntToScalar(subset.width()), 2044 scaled.postScale(SkIntToScalar(subset.width()),
2044 SkIntToScalar(subset.height())); 2045 SkIntToScalar(subset.height()));
2045 scaled.postConcat(matrix); 2046 scaled.postConcat(matrix);
2046 ScopedContentEntry content(this, clipStack, clipRegion, scaled, paint); 2047 ScopedContentEntry content(this, clipStack, clipRegion, scaled, paint);
(...skipping 16 matching lines...) Expand all
2063 } 2064 }
2064 2065
2065 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, 2066 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
2066 SkCanvas::Config8888) { 2067 SkCanvas::Config8888) {
2067 return false; 2068 return false;
2068 } 2069 }
2069 2070
2070 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { 2071 bool SkPDFDevice::allowImageFilter(SkImageFilter*) {
2071 return false; 2072 return false;
2072 } 2073 }
OLDNEW
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFDeviceFlattener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698