| 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 |
| 11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
| 12 #include "SkBitmapKey.h" |
| 12 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
| 13 #include "SkClipStack.h" | 14 #include "SkClipStack.h" |
| 14 #include "SkData.h" | 15 #include "SkData.h" |
| 15 #include "SkDevice.h" | 16 #include "SkDevice.h" |
| 16 #include "SkPaint.h" | 17 #include "SkPaint.h" |
| 17 #include "SkPath.h" | 18 #include "SkPath.h" |
| 18 #include "SkPicture.h" | 19 #include "SkPicture.h" |
| 19 #include "SkRect.h" | 20 #include "SkRect.h" |
| 20 #include "SkRefCnt.h" | 21 #include "SkRefCnt.h" |
| 21 #include "SkStream.h" | 22 #include "SkStream.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 const SkPaint& paint, | 311 const SkPaint& paint, |
| 311 bool hasText, | 312 bool hasText, |
| 312 GraphicStateEntry* entry); | 313 GraphicStateEntry* entry); |
| 313 int addGraphicStateResource(SkPDFObject* gs); | 314 int addGraphicStateResource(SkPDFObject* gs); |
| 314 int addXObjectResource(SkPDFObject* xObject); | 315 int addXObjectResource(SkPDFObject* xObject); |
| 315 | 316 |
| 316 void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* conten
tEntry); | 317 void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* conten
tEntry); |
| 317 int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID); | 318 int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID); |
| 318 | 319 |
| 319 void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry); | 320 void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry); |
| 320 void internalDrawImage(const SkMatrix& matrix, | 321 |
| 322 void internalDrawImage(const SkMatrix& origMatrix, |
| 321 const SkClipStack* clipStack, | 323 const SkClipStack* clipStack, |
| 322 const SkRegion& clipRegion, | 324 const SkRegion& origClipRegion, |
| 323 const SkImage* image, | 325 SkImageBitmap imageBitmap, |
| 324 const SkIRect* srcRect, | |
| 325 const SkPaint& paint); | 326 const SkPaint& paint); |
| 326 | 327 |
| 327 /** Helper method for copyContentToData. It is responsible for copying the | 328 /** Helper method for copyContentToData. It is responsible for copying the |
| 328 * list of content entries |entry| to |data|. | 329 * list of content entries |entry| to |data|. |
| 329 */ | 330 */ |
| 330 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const; | 331 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const; |
| 331 | 332 |
| 332 bool handleInversePath(const SkDraw& d, const SkPath& origPath, | 333 bool handleInversePath(const SkDraw& d, const SkPath& origPath, |
| 333 const SkPaint& paint, bool pathIsMutable, | 334 const SkPaint& paint, bool pathIsMutable, |
| 334 const SkMatrix* prePathMatrix = nullptr); | 335 const SkMatrix* prePathMatrix = nullptr); |
| 335 void handlePointAnnotation(const SkPoint&, const SkMatrix&, const char key[]
, SkData* value); | 336 void handlePointAnnotation(const SkPoint&, const SkMatrix&, const char key[]
, SkData* value); |
| 336 void handlePathAnnotation(const SkPath&, const SkDraw& d, const char key[],
SkData* value); | 337 void handlePathAnnotation(const SkPath&, const SkDraw& d, const char key[],
SkData* value); |
| 337 | 338 |
| 338 typedef SkBaseDevice INHERITED; | 339 typedef SkBaseDevice INHERITED; |
| 339 | 340 |
| 340 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 341 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
| 341 // an SkPDFDevice | 342 // an SkPDFDevice |
| 342 //friend class SkDocument_PDF; | 343 //friend class SkDocument_PDF; |
| 343 //friend class SkPDFImageShader; | 344 //friend class SkPDFImageShader; |
| 344 }; | 345 }; |
| 345 | 346 |
| 346 #endif | 347 #endif |
| OLD | NEW |