OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPDFDevice_DEFINED | 8 #ifndef SkPDFDevice_DEFINED |
9 #define SkPDFDevice_DEFINED | 9 #define SkPDFDevice_DEFINED |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 // We may change the font (i.e. for Type1 support) within a | 187 // We may change the font (i.e. for Type1 support) within a |
188 // ContentEntry. This is the one currently in effect, or nullptr if non
e. | 188 // ContentEntry. This is the one currently in effect, or nullptr if non
e. |
189 SkPDFFont* fFont; | 189 SkPDFFont* fFont; |
190 // In PDF, text size has no default value. It is only valid if fFont is | 190 // In PDF, text size has no default value. It is only valid if fFont is |
191 // not nullptr. | 191 // not nullptr. |
192 SkScalar fTextSize; | 192 SkScalar fTextSize; |
193 }; | 193 }; |
194 | 194 |
195 protected: | 195 protected: |
196 const SkBitmap& onAccessBitmap() override { | |
197 return fLegacyBitmap; | |
198 } | |
199 | |
200 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) over
ride; | 196 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) over
ride; |
201 | 197 |
202 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData*
value) override; | 198 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData*
value) override; |
203 | 199 |
204 void drawSpecial(const SkDraw&, SkSpecialImage*, int x, int y, const SkPaint
&) override; | 200 void drawSpecial(const SkDraw&, SkSpecialImage*, int x, int y, const SkPaint
&) override; |
205 sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; | 201 sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; |
206 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; | 202 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; |
207 sk_sp<SkSpecialImage> snapSpecial() override; | 203 sk_sp<SkSpecialImage> snapSpecial() override; |
208 | 204 |
209 private: | 205 private: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 struct ContentEntry { | 253 struct ContentEntry { |
258 GraphicStateEntry fState; | 254 GraphicStateEntry fState; |
259 SkDynamicMemoryWStream fContent; | 255 SkDynamicMemoryWStream fContent; |
260 }; | 256 }; |
261 SkSinglyLinkedList<ContentEntry> fContentEntries; | 257 SkSinglyLinkedList<ContentEntry> fContentEntries; |
262 | 258 |
263 const SkClipStack* fClipStack; | 259 const SkClipStack* fClipStack; |
264 | 260 |
265 SkScalar fRasterDpi; | 261 SkScalar fRasterDpi; |
266 | 262 |
267 SkBitmap fLegacyBitmap; | |
268 | |
269 SkPDFDocument* fDocument; | 263 SkPDFDocument* fDocument; |
270 //////////////////////////////////////////////////////////////////////////// | 264 //////////////////////////////////////////////////////////////////////////// |
271 | 265 |
272 SkPDFDevice(SkISize pageSize, | 266 SkPDFDevice(SkISize pageSize, |
273 SkScalar rasterDpi, | 267 SkScalar rasterDpi, |
274 SkPDFDocument* doc, | 268 SkPDFDocument* doc, |
275 bool flip); | 269 bool flip); |
276 | 270 |
277 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; | 271 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
278 | 272 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 324 |
331 typedef SkBaseDevice INHERITED; | 325 typedef SkBaseDevice INHERITED; |
332 | 326 |
333 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 327 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
334 // an SkPDFDevice | 328 // an SkPDFDevice |
335 //friend class SkDocument_PDF; | 329 //friend class SkDocument_PDF; |
336 //friend class SkPDFImageShader; | 330 //friend class SkPDFImageShader; |
337 }; | 331 }; |
338 | 332 |
339 #endif | 333 #endif |
OLD | NEW |