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

Side by Side Diff: include/pdf/SkPDFDevice.h

Issue 54913004: Implement DPI for perspective bitmaps in PDF - we save the bitmap at the resolution requested. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: take 2, matrix handling Created 7 years, 1 month 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkPDFDevice_DEFINED 10 #ifndef SkPDFDevice_DEFINED
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return fInitialTransform; 184 return fInitialTransform;
185 } 185 }
186 186
187 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font 187 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font
188 * that shows on this device. 188 * that shows on this device.
189 */ 189 */
190 const SkPDFGlyphSetMap& getFontGlyphUsage() const { 190 const SkPDFGlyphSetMap& getFontGlyphUsage() const {
191 return *(fFontGlyphUsage.get()); 191 return *(fFontGlyphUsage.get());
192 } 192 }
193 193
194 protected:
195 virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y,
196 SkCanvas::Config8888) SK_OVERRIDE;
197
198 virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE;
199 194
200 /** 195 /**
201 * rasterDpi - the DPI at which features without native PDF support 196 * rasterDpi - the DPI at which features without native PDF support
202 * will be rasterized (e.g. draw image with perspective, 197 * will be rasterized (e.g. draw image with perspective,
203 * draw text with perspective, ...) 198 * draw text with perspective, ...)
204 * A larger DPI would create a PDF that reflects the original 199 * A larger DPI would create a PDF that reflects the original
205 * intent with better fidelity, but it can make for larger 200 * intent with better fidelity, but it can make for larger
206 * PDF files too, which would use more memory while rendering, 201 * PDF files too, which would use more memory while rendering,
207 * and it would be slower to be processed or sent online or 202 * and it would be slower to be processed or sent online or
208 * to printer. 203 * to printer.
209 */ 204 */
210 void setRasterDpi(SkScalar rasterDpi) { 205 void setRasterDpi(SkScalar rasterDpi) {
211 fRasterDpi = rasterDpi; 206 fRasterDpi = rasterDpi;
212 } 207 }
213 208
209 protected:
210 virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y,
211 SkCanvas::Config8888) SK_OVERRIDE;
212
213 virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE;
214
214 private: 215 private:
215 // TODO(vandebo): push most of SkPDFDevice's state into a core object in 216 // TODO(vandebo): push most of SkPDFDevice's state into a core object in
216 // order to get the right access levels without using friend. 217 // order to get the right access levels without using friend.
217 friend class ScopedContentEntry; 218 friend class ScopedContentEntry;
218 219
219 SkISize fPageSize; 220 SkISize fPageSize;
220 SkISize fContentSize; 221 SkISize fContentSize;
221 SkMatrix fInitialTransform; 222 SkMatrix fInitialTransform;
222 SkClipStack fExistingClipStack; 223 SkClipStack fExistingClipStack;
223 SkRegion fExistingClipRegion; 224 SkRegion fExistingClipRegion;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 330
330 typedef SkBitmapDevice INHERITED; 331 typedef SkBitmapDevice INHERITED;
331 332
332 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create 333 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
333 // an SkPDFDevice 334 // an SkPDFDevice
334 //friend class SkDocument_PDF; 335 //friend class SkDocument_PDF;
335 //friend class SkPDFImageShader; 336 //friend class SkPDFImageShader;
336 }; 337 };
337 338
338 #endif 339 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698