| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // Deprecated, please use SkDocument::CreatePdf() instead. | 68 // Deprecated, please use SkDocument::CreatePdf() instead. |
| 69 SK_API SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize, | 69 SK_API SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize, |
| 70 const SkMatrix& initialTransform); | 70 const SkMatrix& initialTransform); |
| 71 SK_API virtual ~SkPDFDevice(); | 71 SK_API virtual ~SkPDFDevice(); |
| 72 | 72 |
| 73 /** These are called inside the per-device-layer loop for each draw call. | 73 /** These are called inside the per-device-layer loop for each draw call. |
| 74 When these are called, we have already applied any saveLayer operations, | 74 When these are called, we have already applied any saveLayer operations, |
| 75 and are handling any looping from the paint, and any effects from the | 75 and are handling any looping from the paint, and any effects from the |
| 76 DrawFilter. | 76 DrawFilter. |
| 77 */ | 77 */ |
| 78 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 78 void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; |
| 79 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, | 79 void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
| 80 size_t count, const SkPoint[], | 80 size_t count, const SkPoint[], |
| 81 const SkPaint& paint) SK_OVERRIDE; | 81 const SkPaint& paint) SK_OVERRIDE; |
| 82 virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint); | 82 void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) SK_OVERR
IDE; |
| 83 virtual void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& pain
t) SK_OVERRIDE; | 83 void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) SK_OV
ERRIDE; |
| 84 virtual void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& pain
t) SK_OVERRIDE; | 84 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) SK_OV
ERRIDE; |
| 85 virtual void drawPath(const SkDraw&, const SkPath& origpath, | 85 void drawPath(const SkDraw&, const SkPath& origpath, |
| 86 const SkPaint& paint, const SkMatrix* prePathMatrix, | 86 const SkPaint& paint, const SkMatrix* prePathMatrix, |
| 87 bool pathIsMutable) SK_OVERRIDE; | 87 bool pathIsMutable) SK_OVERRIDE; |
| 88 virtual void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, | 88 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
| 89 const SkRect* src, const SkRect& dst, | 89 const SkRect* src, const SkRect& dst, |
| 90 const SkPaint& paint, | 90 const SkPaint& paint, |
| 91 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE
; | 91 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE; |
| 92 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 92 void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
| 93 const SkMatrix& matrix, const SkPaint&) SK_OVERRIDE; | 93 const SkMatrix& matrix, const SkPaint&) SK_OVERRIDE; |
| 94 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, | 94 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, |
| 95 const SkPaint& paint) SK_OVERRIDE; | 95 const SkPaint& paint) SK_OVERRIDE; |
| 96 virtual void drawText(const SkDraw&, const void* text, size_t len, | 96 void drawText(const SkDraw&, const void* text, size_t len, |
| 97 SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE; | 97 SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE; |
| 98 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | 98 void drawPosText(const SkDraw&, const void* text, size_t len, |
| 99 const SkScalar pos[], int scalarsPerPos, | 99 const SkScalar pos[], int scalarsPerPos, |
| 100 const SkPoint& offset, const SkPaint&) SK_OVERRIDE; | 100 const SkPoint& offset, const SkPaint&) SK_OVERRIDE; |
| 101 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | 101 void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
| 102 const SkPath& path, const SkMatrix* matrix, | 102 const SkPath& path, const SkMatrix* matrix, |
| 103 const SkPaint& paint) SK_OVERRIDE; | 103 const SkPaint& paint) SK_OVERRIDE; |
| 104 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, | 104 void drawVertices(const SkDraw&, SkCanvas::VertexMode, |
| 105 int vertexCount, const SkPoint verts[], | 105 int vertexCount, const SkPoint verts[], |
| 106 const SkPoint texs[], const SkColor colors[], | 106 const SkPoint texs[], const SkColor colors[], |
| 107 SkXfermode* xmode, const uint16_t indices[], | 107 SkXfermode* xmode, const uint16_t indices[], |
| 108 int indexCount, const SkPaint& paint) SK_OVERRIDE; | 108 int indexCount, const SkPaint& paint) SK_OVERRIDE; |
| 109 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 109 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
| 110 const SkPaint&) SK_OVERRIDE; | 110 const SkPaint&) SK_OVERRIDE; |
| 111 | 111 |
| 112 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; | 112 void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; |
| 113 virtual void onDetachFromCanvas() SK_OVERRIDE; | 113 void onDetachFromCanvas() SK_OVERRIDE; |
| 114 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | 114 SkImageInfo imageInfo() const SK_OVERRIDE; |
| 115 | 115 |
| 116 enum DrawingArea { | 116 enum DrawingArea { |
| 117 kContent_DrawingArea, // Drawing area for the page content. | 117 kContent_DrawingArea, // Drawing area for the page content. |
| 118 kMargin_DrawingArea, // Drawing area for the margin content. | 118 kMargin_DrawingArea, // Drawing area for the margin content. |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 /** Sets the drawing area for the device. Subsequent draw calls are directed | 121 /** Sets the drawing area for the device. Subsequent draw calls are directed |
| 122 * to the specific drawing area (margin or content). The default drawing | 122 * to the specific drawing area (margin or content). The default drawing |
| 123 * area is the content drawing area. | 123 * area is the content drawing area. |
| 124 * | 124 * |
| (...skipping 205 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 |