| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) overr
ide; | 92 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) overr
ide; |
| 93 void drawPath(const SkDraw&, const SkPath& origpath, | 93 void drawPath(const SkDraw&, const SkPath& origpath, |
| 94 const SkPaint& paint, const SkMatrix* prePathMatrix, | 94 const SkPaint& paint, const SkMatrix* prePathMatrix, |
| 95 bool pathIsMutable) override; | 95 bool pathIsMutable) override; |
| 96 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect
* src, | 96 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect
* src, |
| 97 const SkRect& dst, const SkPaint&, SkCanvas::SrcRectCons
traint) override; | 97 const SkRect& dst, const SkPaint&, SkCanvas::SrcRectCons
traint) override; |
| 98 void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 98 void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
| 99 const SkMatrix& matrix, const SkPaint&) override; | 99 const SkMatrix& matrix, const SkPaint&) override; |
| 100 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, | 100 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, |
| 101 const SkPaint& paint) override; | 101 const SkPaint& paint) override; |
| 102 void drawImage(const SkDraw&, |
| 103 const SkImage*, |
| 104 SkScalar x, |
| 105 SkScalar y, |
| 106 const SkPaint&) override; |
| 107 void drawImageRect(const SkDraw&, |
| 108 const SkImage*, |
| 109 const SkRect* src, |
| 110 const SkRect& dst, |
| 111 const SkPaint&, |
| 112 SkCanvas::SrcRectConstraint) override; |
| 102 void drawText(const SkDraw&, const void* text, size_t len, | 113 void drawText(const SkDraw&, const void* text, size_t len, |
| 103 SkScalar x, SkScalar y, const SkPaint&) override; | 114 SkScalar x, SkScalar y, const SkPaint&) override; |
| 104 void drawPosText(const SkDraw&, const void* text, size_t len, | 115 void drawPosText(const SkDraw&, const void* text, size_t len, |
| 105 const SkScalar pos[], int scalarsPerPos, | 116 const SkScalar pos[], int scalarsPerPos, |
| 106 const SkPoint& offset, const SkPaint&) override; | 117 const SkPoint& offset, const SkPaint&) override; |
| 107 void drawVertices(const SkDraw&, SkCanvas::VertexMode, | 118 void drawVertices(const SkDraw&, SkCanvas::VertexMode, |
| 108 int vertexCount, const SkPoint verts[], | 119 int vertexCount, const SkPoint verts[], |
| 109 const SkPoint texs[], const SkColor colors[], | 120 const SkPoint texs[], const SkColor colors[], |
| 110 SkXfermode* xmode, const uint16_t indices[], | 121 SkXfermode* xmode, const uint16_t indices[], |
| 111 int indexCount, const SkPaint& paint) override; | 122 int indexCount, const SkPaint& paint) override; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 const SkPaint& paint, | 283 const SkPaint& paint, |
| 273 bool hasText, | 284 bool hasText, |
| 274 GraphicStateEntry* entry); | 285 GraphicStateEntry* entry); |
| 275 int addGraphicStateResource(SkPDFObject* gs); | 286 int addGraphicStateResource(SkPDFObject* gs); |
| 276 int addXObjectResource(SkPDFObject* xObject); | 287 int addXObjectResource(SkPDFObject* xObject); |
| 277 | 288 |
| 278 void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* conten
tEntry); | 289 void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* conten
tEntry); |
| 279 int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID); | 290 int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID); |
| 280 | 291 |
| 281 void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry); | 292 void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry); |
| 282 void internalDrawBitmap(const SkMatrix& matrix, | 293 void internalDrawImage(const SkMatrix& matrix, |
| 283 const SkClipStack* clipStack, | 294 const SkClipStack* clipStack, |
| 284 const SkRegion& clipRegion, | 295 const SkRegion& clipRegion, |
| 285 const SkBitmap& bitmap, | 296 const SkImage* image, |
| 286 const SkIRect* srcRect, | 297 const SkIRect* srcRect, |
| 287 const SkPaint& paint); | 298 const SkPaint& paint); |
| 288 | 299 |
| 289 /** Helper method for copyContentToData. It is responsible for copying the | 300 /** Helper method for copyContentToData. It is responsible for copying the |
| 290 * list of content entries |entry| to |data|. | 301 * list of content entries |entry| to |data|. |
| 291 */ | 302 */ |
| 292 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const; | 303 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const; |
| 293 | 304 |
| 294 bool handleInversePath(const SkDraw& d, const SkPath& origPath, | 305 bool handleInversePath(const SkDraw& d, const SkPath& origPath, |
| 295 const SkPaint& paint, bool pathIsMutable, | 306 const SkPaint& paint, bool pathIsMutable, |
| 296 const SkMatrix* prePathMatrix = nullptr); | 307 const SkMatrix* prePathMatrix = nullptr); |
| 297 bool handlePointAnnotation(const SkPoint* points, size_t count, | 308 bool handlePointAnnotation(const SkPoint* points, size_t count, |
| 298 const SkMatrix& matrix, SkAnnotation* annot); | 309 const SkMatrix& matrix, SkAnnotation* annot); |
| 299 bool handlePathAnnotation(const SkPath& path, const SkDraw& d, | 310 bool handlePathAnnotation(const SkPath& path, const SkDraw& d, |
| 300 SkAnnotation* annot); | 311 SkAnnotation* annot); |
| 301 | 312 |
| 302 typedef SkBaseDevice INHERITED; | 313 typedef SkBaseDevice INHERITED; |
| 303 | 314 |
| 304 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 315 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
| 305 // an SkPDFDevice | 316 // an SkPDFDevice |
| 306 //friend class SkDocument_PDF; | 317 //friend class SkDocument_PDF; |
| 307 //friend class SkPDFImageShader; | 318 //friend class SkPDFImageShader; |
| 308 }; | 319 }; |
| 309 | 320 |
| 310 #endif | 321 #endif |
| OLD | NEW |