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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 * intent with better fidelity, but it can make for larger | 200 * intent with better fidelity, but it can make for larger |
201 * PDF files too, which would use more memory while rendering, | 201 * PDF files too, which would use more memory while rendering, |
202 * 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 |
203 * to printer. | 203 * to printer. |
204 */ | 204 */ |
205 void setRasterDpi(SkScalar rasterDpi) { | 205 void setRasterDpi(SkScalar rasterDpi) { |
206 fRasterDpi = rasterDpi; | 206 fRasterDpi = rasterDpi; |
207 } | 207 } |
208 | 208 |
209 protected: | 209 protected: |
210 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE { | 210 const SkBitmap& onAccessBitmap() SK_OVERRIDE { |
211 return fLegacyBitmap; | 211 return fLegacyBitmap; |
212 } | 212 } |
213 | 213 |
214 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_
OVERRIDE; | 214 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
; |
215 | 215 |
216 private: | 216 private: |
217 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 217 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
218 // order to get the right access levels without using friend. | 218 // order to get the right access levels without using friend. |
219 friend class ScopedContentEntry; | 219 friend class ScopedContentEntry; |
220 | 220 |
221 SkISize fPageSize; | 221 SkISize fPageSize; |
222 SkISize fContentSize; | 222 SkISize fContentSize; |
223 SkMatrix fInitialTransform; | 223 SkMatrix fInitialTransform; |
224 SkClipStack fExistingClipStack; | 224 SkClipStack fExistingClipStack; |
(...skipping 25 matching lines...) Expand all Loading... |
250 | 250 |
251 SkPicture::EncodeBitmap fEncoder; | 251 SkPicture::EncodeBitmap fEncoder; |
252 SkScalar fRasterDpi; | 252 SkScalar fRasterDpi; |
253 | 253 |
254 SkBitmap fLegacyBitmap; | 254 SkBitmap fLegacyBitmap; |
255 | 255 |
256 SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack, | 256 SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack, |
257 const SkRegion& existingClipRegion); | 257 const SkRegion& existingClipRegion); |
258 | 258 |
259 // override from SkBaseDevice | 259 // override from SkBaseDevice |
260 virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRID
E; | 260 SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; |
261 | 261 |
262 void init(); | 262 void init(); |
263 void cleanUp(bool clearFontUsage); | 263 void cleanUp(bool clearFontUsage); |
264 SkPDFFormXObject* createFormXObjectFromDevice(); | 264 SkPDFFormXObject* createFormXObjectFromDevice(); |
265 | 265 |
266 void drawFormXObjectWithMask(int xObjectIndex, | 266 void drawFormXObjectWithMask(int xObjectIndex, |
267 SkPDFFormXObject* mask, | 267 SkPDFFormXObject* mask, |
268 const SkClipStack* clipStack, | 268 const SkClipStack* clipStack, |
269 const SkRegion& clipRegion, | 269 const SkRegion& clipRegion, |
270 SkXfermode::Mode mode, | 270 SkXfermode::Mode mode, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 typedef SkBaseDevice INHERITED; | 331 typedef SkBaseDevice INHERITED; |
332 | 332 |
333 // 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 |
334 // an SkPDFDevice | 334 // an SkPDFDevice |
335 //friend class SkDocument_PDF; | 335 //friend class SkDocument_PDF; |
336 //friend class SkPDFImageShader; | 336 //friend class SkPDFImageShader; |
337 }; | 337 }; |
338 | 338 |
339 #endif | 339 #endif |
OLD | NEW |