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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 const SkPDFGlyphSetMap& getFontGlyphUsage() const { | 190 const SkPDFGlyphSetMap& getFontGlyphUsage() const { |
191 return *(fFontGlyphUsage.get()); | 191 return *(fFontGlyphUsage.get()); |
192 } | 192 } |
193 | 193 |
194 protected: | 194 protected: |
195 virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y, | 195 virtual bool onReadPixels(const SkBitmap& bitmap, int x, int y, |
196 SkCanvas::Config8888) SK_OVERRIDE; | 196 SkCanvas::Config8888) SK_OVERRIDE; |
197 | 197 |
198 virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; | 198 virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; |
199 | 199 |
| 200 void setRasterDpi(SkScalar dpi) { |
| 201 fDpi = dpi; |
| 202 } |
| 203 |
200 private: | 204 private: |
201 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 205 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
202 // order to get the right access levels without using friend. | 206 // order to get the right access levels without using friend. |
203 friend class ScopedContentEntry; | 207 friend class ScopedContentEntry; |
204 | 208 |
205 SkISize fPageSize; | 209 SkISize fPageSize; |
206 SkISize fContentSize; | 210 SkISize fContentSize; |
207 SkMatrix fInitialTransform; | 211 SkMatrix fInitialTransform; |
208 SkClipStack fExistingClipStack; | 212 SkClipStack fExistingClipStack; |
209 SkRegion fExistingClipRegion; | 213 SkRegion fExistingClipRegion; |
(...skipping 16 matching lines...) Expand all Loading... |
226 | 230 |
227 // Accessor and setter functions based on the current DrawingArea. | 231 // Accessor and setter functions based on the current DrawingArea. |
228 SkAutoTDelete<ContentEntry>* getContentEntries(); | 232 SkAutoTDelete<ContentEntry>* getContentEntries(); |
229 ContentEntry* getLastContentEntry(); | 233 ContentEntry* getLastContentEntry(); |
230 void setLastContentEntry(ContentEntry* contentEntry); | 234 void setLastContentEntry(ContentEntry* contentEntry); |
231 | 235 |
232 // Glyph ids used for each font on this device. | 236 // Glyph ids used for each font on this device. |
233 SkAutoTDelete<SkPDFGlyphSetMap> fFontGlyphUsage; | 237 SkAutoTDelete<SkPDFGlyphSetMap> fFontGlyphUsage; |
234 | 238 |
235 SkPicture::EncodeBitmap fEncoder; | 239 SkPicture::EncodeBitmap fEncoder; |
| 240 SkScalar fDpi; |
236 | 241 |
237 SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack, | 242 SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack, |
238 const SkRegion& existingClipRegion); | 243 const SkRegion& existingClipRegion); |
239 | 244 |
240 // override from SkBaseDevice | 245 // override from SkBaseDevice |
241 virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config, | 246 virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config, |
242 int width, int height, | 247 int width, int height, |
243 bool isOpaque, | 248 bool isOpaque, |
244 Usage usage) SK_OVERRIDE; | 249 Usage usage) SK_OVERRIDE; |
245 | 250 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 318 |
314 typedef SkBitmapDevice INHERITED; | 319 typedef SkBitmapDevice INHERITED; |
315 | 320 |
316 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 321 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
317 // an SkPDFDevice | 322 // an SkPDFDevice |
318 //friend class SkDocument_PDF; | 323 //friend class SkDocument_PDF; |
319 //friend class SkPDFImageShader; | 324 //friend class SkPDFImageShader; |
320 }; | 325 }; |
321 | 326 |
322 #endif | 327 #endif |
OLD | NEW |