OLD | NEW |
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return fInitialTransform; | 187 return fInitialTransform; |
188 } | 188 } |
189 | 189 |
190 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font | 190 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font |
191 * that shows on this device. | 191 * that shows on this device. |
192 */ | 192 */ |
193 const SkPDFGlyphSetMap& getFontGlyphUsage() const { | 193 const SkPDFGlyphSetMap& getFontGlyphUsage() const { |
194 return *(fFontGlyphUsage.get()); | 194 return *(fFontGlyphUsage.get()); |
195 } | 195 } |
196 | 196 |
197 protected: | |
198 virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y, | |
199 SkCanvas::Config8888) SK_OVERRIDE; | |
200 | |
201 virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; | |
202 | 197 |
203 /** | 198 /** |
204 * rasterDpi - the DPI at which features without native PDF support | 199 * rasterDpi - the DPI at which features without native PDF support |
205 * will be rasterized (e.g. draw image with perspective, | 200 * will be rasterized (e.g. draw image with perspective, |
206 * draw text with perspective, ...) | 201 * draw text with perspective, ...) |
207 * A larger DPI would create a PDF that reflects the original | 202 * A larger DPI would create a PDF that reflects the original |
208 * intent with better fidelity, but it can make for larger | 203 * intent with better fidelity, but it can make for larger |
209 * PDF files too, which would use more memory while rendering, | 204 * PDF files too, which would use more memory while rendering, |
210 * and it would be slower to be processed or sent online or | 205 * and it would be slower to be processed or sent online or |
211 * to printer. | 206 * to printer. |
212 */ | 207 */ |
213 void setRasterDpi(SkScalar rasterDpi) { | 208 void setRasterDpi(SkScalar rasterDpi) { |
214 fRasterDpi = rasterDpi; | 209 fRasterDpi = rasterDpi; |
215 } | 210 } |
216 | 211 |
| 212 protected: |
| 213 virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y, |
| 214 SkCanvas::Config8888) SK_OVERRIDE; |
| 215 |
| 216 virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; |
| 217 |
217 private: | 218 private: |
218 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 219 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
219 // order to get the right access levels without using friend. | 220 // order to get the right access levels without using friend. |
220 friend class ScopedContentEntry; | 221 friend class ScopedContentEntry; |
221 | 222 |
222 SkISize fPageSize; | 223 SkISize fPageSize; |
223 SkISize fContentSize; | 224 SkISize fContentSize; |
224 SkMatrix fInitialTransform; | 225 SkMatrix fInitialTransform; |
225 SkClipStack fExistingClipStack; | 226 SkClipStack fExistingClipStack; |
226 SkRegion fExistingClipRegion; | 227 SkRegion fExistingClipRegion; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 333 |
333 typedef SkBitmapDevice INHERITED; | 334 typedef SkBitmapDevice INHERITED; |
334 | 335 |
335 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 336 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
336 // an SkPDFDevice | 337 // an SkPDFDevice |
337 //friend class SkDocument_PDF; | 338 //friend class SkDocument_PDF; |
338 //friend class SkPDFImageShader; | 339 //friend class SkPDFImageShader; |
339 }; | 340 }; |
340 | 341 |
341 #endif | 342 #endif |
OLD | NEW |