| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const SkScalar pos[], int scalarsPerPos, | 112 const SkScalar pos[], int scalarsPerPos, |
| 113 const SkPoint& offset, const SkPaint&) override; | 113 const SkPoint& offset, const SkPaint&) override; |
| 114 void drawVertices(const SkDraw&, SkCanvas::VertexMode, | 114 void drawVertices(const SkDraw&, SkCanvas::VertexMode, |
| 115 int vertexCount, const SkPoint verts[], | 115 int vertexCount, const SkPoint verts[], |
| 116 const SkPoint texs[], const SkColor colors[], | 116 const SkPoint texs[], const SkColor colors[], |
| 117 SkXfermode* xmode, const uint16_t indices[], | 117 SkXfermode* xmode, const uint16_t indices[], |
| 118 int indexCount, const SkPaint& paint) override; | 118 int indexCount, const SkPaint& paint) override; |
| 119 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 119 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
| 120 const SkPaint&) override; | 120 const SkPaint&) override; |
| 121 | 121 |
| 122 void onAttachToCanvas(SkCanvas* canvas) override; | |
| 123 void onDetachFromCanvas() override; | |
| 124 SkImageInfo imageInfo() const override; | 122 SkImageInfo imageInfo() const override; |
| 125 | 123 |
| 126 // PDF specific methods. | 124 // PDF specific methods. |
| 127 | 125 |
| 128 /** Create the resource dictionary for this device. */ | 126 /** Create the resource dictionary for this device. */ |
| 129 sk_sp<SkPDFDict> makeResourceDict() const; | 127 sk_sp<SkPDFDict> makeResourceDict() const; |
| 130 | 128 |
| 131 /** Get the fonts used on this device. | 129 /** Get the fonts used on this device. |
| 132 */ | 130 */ |
| 133 const SkTDArray<SkPDFFont*>& getFontResources() const; | 131 const SkTDArray<SkPDFFont*>& getFontResources() const; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 SkTDArray<SkPDFObject*> fXObjectResources; | 247 SkTDArray<SkPDFObject*> fXObjectResources; |
| 250 SkTDArray<SkPDFFont*> fFontResources; | 248 SkTDArray<SkPDFFont*> fFontResources; |
| 251 SkTDArray<SkPDFObject*> fShaderResources; | 249 SkTDArray<SkPDFObject*> fShaderResources; |
| 252 | 250 |
| 253 struct ContentEntry { | 251 struct ContentEntry { |
| 254 GraphicStateEntry fState; | 252 GraphicStateEntry fState; |
| 255 SkDynamicMemoryWStream fContent; | 253 SkDynamicMemoryWStream fContent; |
| 256 }; | 254 }; |
| 257 SkSinglyLinkedList<ContentEntry> fContentEntries; | 255 SkSinglyLinkedList<ContentEntry> fContentEntries; |
| 258 | 256 |
| 259 const SkClipStack* fClipStack; | |
| 260 | |
| 261 SkScalar fRasterDpi; | 257 SkScalar fRasterDpi; |
| 262 | 258 |
| 263 SkPDFDocument* fDocument; | 259 SkPDFDocument* fDocument; |
| 264 //////////////////////////////////////////////////////////////////////////// | 260 //////////////////////////////////////////////////////////////////////////// |
| 265 | 261 |
| 266 SkPDFDevice(SkISize pageSize, | 262 SkPDFDevice(SkISize pageSize, |
| 267 SkScalar rasterDpi, | 263 SkScalar rasterDpi, |
| 268 SkPDFDocument* doc, | 264 SkPDFDocument* doc, |
| 269 bool flip); | 265 bool flip); |
| 270 | 266 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 320 |
| 325 typedef SkBaseDevice INHERITED; | 321 typedef SkBaseDevice INHERITED; |
| 326 | 322 |
| 327 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 323 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
| 328 // an SkPDFDevice | 324 // an SkPDFDevice |
| 329 //friend class SkDocument_PDF; | 325 //friend class SkDocument_PDF; |
| 330 //friend class SkPDFImageShader; | 326 //friend class SkPDFImageShader; |
| 331 }; | 327 }; |
| 332 | 328 |
| 333 #endif | 329 #endif |
| OLD | NEW |