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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 329 |
329 typedef SkBitmapDevice INHERITED; | 330 typedef SkBitmapDevice INHERITED; |
330 | 331 |
331 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 332 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
332 // an SkPDFDevice | 333 // an SkPDFDevice |
333 //friend class SkDocument_PDF; | 334 //friend class SkDocument_PDF; |
334 //friend class SkPDFImageShader; | 335 //friend class SkPDFImageShader; |
335 }; | 336 }; |
336 | 337 |
337 #endif | 338 #endif |
OLD | NEW |