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 "SkCanvas.h" | 12 #include "SkCanvas.h" |
13 #include "SkClipStack.h" | 13 #include "SkClipStack.h" |
14 #include "SkData.h" | 14 #include "SkData.h" |
15 #include "SkDevice.h" | 15 #include "SkDevice.h" |
16 #include "SkPaint.h" | 16 #include "SkPaint.h" |
17 #include "SkRect.h" | 17 #include "SkRect.h" |
18 #include "SkRefCnt.h" | 18 #include "SkRefCnt.h" |
19 #include "SkSinglyLinkedList.h" | |
19 #include "SkStream.h" | 20 #include "SkStream.h" |
20 #include "SkTDArray.h" | 21 #include "SkTDArray.h" |
21 | 22 #include "SkTextBlob.h" |
22 #include "SkSinglyLinkedList.h" | |
23 | 23 |
24 class SkImageBitmap; | 24 class SkImageBitmap; |
25 class SkPath; | 25 class SkPath; |
26 class SkPDFArray; | 26 class SkPDFArray; |
27 class SkPDFCanon; | 27 class SkPDFCanon; |
28 class SkPDFDevice; | 28 class SkPDFDevice; |
29 class SkPDFDocument; | 29 class SkPDFDocument; |
30 class SkPDFDict; | 30 class SkPDFDict; |
31 class SkPDFFont; | 31 class SkPDFFont; |
32 class SkPDFObject; | 32 class SkPDFObject; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 SkImageInfo imageInfo() const override; | 122 SkImageInfo imageInfo() const override; |
123 | 123 |
124 // PDF specific methods. | 124 // PDF specific methods. |
125 | 125 |
126 void drawTextInternal(const SkDraw&, const void*, size_t, const SkScalar pos [], | |
bungeman-skia
2016/08/15 17:03:37
Any particular reason for this to be public?
hal.canary
2016/08/15 18:14:22
no.
fixed.
| |
127 SkTextBlob::GlyphPositioning, SkPoint, const SkPaint&) ; | |
128 | |
126 /** Create the resource dictionary for this device. */ | 129 /** Create the resource dictionary for this device. */ |
127 sk_sp<SkPDFDict> makeResourceDict() const; | 130 sk_sp<SkPDFDict> makeResourceDict() const; |
128 | 131 |
129 /** Get the fonts used on this device. | 132 /** Get the fonts used on this device. |
130 */ | 133 */ |
131 const SkTDArray<SkPDFFont*>& getFontResources() const; | 134 const SkTDArray<SkPDFFont*>& getFontResources() const; |
132 | 135 |
133 /** Add our annotations (link to urls and destinations) to the supplied | 136 /** Add our annotations (link to urls and destinations) to the supplied |
134 * array. | 137 * array. |
135 * @param array Array to add annotations to. | 138 * @param array Array to add annotations to. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 | 187 |
185 // We may change the font (i.e. for Type1 support) within a | 188 // We may change the font (i.e. for Type1 support) within a |
186 // ContentEntry. This is the one currently in effect, or nullptr if non e. | 189 // ContentEntry. This is the one currently in effect, or nullptr if non e. |
187 SkPDFFont* fFont; | 190 SkPDFFont* fFont; |
188 // In PDF, text size has no default value. It is only valid if fFont is | 191 // In PDF, text size has no default value. It is only valid if fFont is |
189 // not nullptr. | 192 // not nullptr. |
190 SkScalar fTextSize; | 193 SkScalar fTextSize; |
191 }; | 194 }; |
192 | 195 |
193 protected: | 196 protected: |
194 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) over ride; | 197 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) over ride; |
bungeman-skia
2016/08/15 17:03:37
Since I was looking at visibility, these are prote
hal.canary
2016/08/15 18:14:22
Acknowledged.
| |
195 | 198 |
196 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData* value) override; | 199 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData* value) override; |
197 | 200 |
198 void drawSpecial(const SkDraw&, SkSpecialImage*, int x, int y, const SkPaint &) override; | 201 void drawSpecial(const SkDraw&, SkSpecialImage*, int x, int y, const SkPaint &) override; |
199 sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; | 202 sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&) override; |
200 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; | 203 sk_sp<SkSpecialImage> makeSpecial(const SkImage*) override; |
201 sk_sp<SkSpecialImage> snapSpecial() override; | 204 sk_sp<SkSpecialImage> snapSpecial() override; |
202 | 205 |
203 private: | 206 private: |
204 struct RectWithData { | 207 struct RectWithData { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 | 314 |
312 typedef SkBaseDevice INHERITED; | 315 typedef SkBaseDevice INHERITED; |
313 | 316 |
314 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create | 317 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create |
315 // an SkPDFDevice | 318 // an SkPDFDevice |
316 //friend class SkDocument_PDF; | 319 //friend class SkDocument_PDF; |
317 //friend class SkPDFImageShader; | 320 //friend class SkPDFImageShader; |
318 }; | 321 }; |
319 | 322 |
320 #endif | 323 #endif |
OLD | NEW |