OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 SkLiteDL_DEFINED | 8 #ifndef SkLiteDL_DEFINED |
9 #define SkLiteDL_DEFINED | 9 #define SkLiteDL_DEFINED |
10 | 10 |
11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
12 #include "SkPaint.h" | 12 #include "SkPaint.h" |
13 #include "SkPath.h" | 13 #include "SkPath.h" |
14 #include "SkDrawable.h" | 14 #include "SkDrawable.h" |
15 #include "SkRect.h" | 15 #include "SkRect.h" |
16 #include "SkTDArray.h" | 16 #include "SkTDArray.h" |
17 | 17 |
18 class GrContext; | 18 class GrContext; |
19 | 19 |
20 class SkLiteDL final : public SkDrawable { | 20 class SkLiteDL final : public SkDrawable { |
21 public: | 21 public: |
22 static sk_sp<SkLiteDL> New(SkRect); | 22 static sk_sp<SkLiteDL> New(SkRect); |
23 | 23 |
24 void optimizeFor(GrContext*); | 24 void optimizeFor(GrContext*); |
25 | 25 |
26 void save(); | 26 void save(); |
27 void saveLayer(const SkRect*, const SkPaint*, const SkImageFilter*, uint32_t
); | 27 void saveLayer(const SkRect*, const SkPaint*, const SkImageFilter*, SkCanvas
::SaveLayerFlags); |
28 void restore(); | 28 void restore(); |
29 | 29 |
30 void concat (const SkMatrix&); | 30 void concat (const SkMatrix&); |
31 void setMatrix (const SkMatrix&); | 31 void setMatrix (const SkMatrix&); |
32 void translateZ(SkScalar) {/*TODO*/} | 32 void translateZ(SkScalar); |
33 | 33 |
34 void clipPath (const SkPath&, SkRegion::Op, bool aa); | 34 void clipPath (const SkPath&, SkRegion::Op, bool aa); |
35 void clipRect (const SkRect&, SkRegion::Op, bool aa); | 35 void clipRect (const SkRect&, SkRegion::Op, bool aa); |
36 void clipRRect (const SkRRect&, SkRegion::Op, bool aa); | 36 void clipRRect (const SkRRect&, SkRegion::Op, bool aa); |
37 void clipRegion(const SkRegion&, SkRegion::Op); | 37 void clipRegion(const SkRegion&, SkRegion::Op); |
38 | 38 |
39 | 39 |
40 void drawPaint (const SkPaint&); | 40 void drawPaint (const SkPaint&); |
41 void drawPath (const SkPath&, const SkPaint&); | 41 void drawPath (const SkPath&, const SkPaint&); |
42 void drawRect (const SkRect&, const SkPaint&); | 42 void drawRect (const SkRect&, const SkPaint&); |
43 void drawOval (const SkRect&, const SkPaint&); | 43 void drawOval (const SkRect&, const SkPaint&); |
44 void drawRRect (const SkRRect&, const SkPaint&); | 44 void drawRRect (const SkRRect&, const SkPaint&); |
45 void drawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); | 45 void drawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); |
46 | 46 |
47 void drawAnnotation (const SkRect&, const char*, SkData*) {/*TODO*/} | 47 void drawAnnotation (const SkRect&, const char*, SkData*); |
48 void drawDrawable (SkDrawable*, const SkMatrix*) {/*TODO*/} | 48 void drawDrawable (SkDrawable*, const SkMatrix*); |
49 void drawPicture (const SkPicture*, const SkMatrix*, const SkPaint*)
{/*TODO*/} | 49 void drawPicture (const SkPicture*, const SkMatrix*, const SkPaint*); |
50 void drawShadowedPicture(const SkPicture*, const SkMatrix*, const SkPaint*)
{/*TODO*/} | 50 void drawShadowedPicture(const SkPicture*, const SkMatrix*, const SkPaint*); |
51 | 51 |
52 void drawText (const void*, size_t, SkScalar, SkScalar, const SkPaint&
); | 52 void drawText (const void*, size_t, SkScalar, SkScalar, const SkPaint&
); |
53 void drawPosText (const void*, size_t, const SkPoint[], const SkPaint&); | 53 void drawPosText (const void*, size_t, const SkPoint[], const SkPaint&); |
54 void drawPosTextH (const void*, size_t, const SkScalar[], SkScalar, const
SkPaint&); | 54 void drawPosTextH (const void*, size_t, const SkScalar[], SkScalar, const
SkPaint&); |
55 void drawTextOnPath (const void*, size_t, const SkPath&, const SkMatrix*, co
nst SkPaint&) {/*TODO*/} | 55 void drawTextOnPath (const void*, size_t, const SkPath&, const SkMatrix*, co
nst SkPaint&); |
56 void drawTextRSXForm(const void*, size_t, const SkRSXform[], const SkRect*,
const SkPaint&) {/*TODO*/} | 56 void drawTextRSXform(const void*, size_t, const SkRSXform[], const SkRect*,
const SkPaint&); |
57 void drawTextBlob (const SkTextBlob*, SkScalar,SkScalar, const SkPaint&); | 57 void drawTextBlob (const SkTextBlob*, SkScalar,SkScalar, const SkPaint&); |
58 | 58 |
59 void drawBitmap (const SkBitmap&, SkScalar, SkScalar, const Sk
Paint*); | 59 void drawBitmap (const SkBitmap&, SkScalar, SkScalar, const Sk
Paint*); |
60 void drawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&, const Sk
Paint*); | 60 void drawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&, const Sk
Paint*); |
61 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const Sk
Paint*, | 61 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const Sk
Paint*, |
62 SkCanvas::SrcRectConstraint); | 62 SkCanvas::SrcRectConstraint); |
63 | 63 |
64 void drawImage (const SkImage*, SkScalar,SkScalar, const SkPa
int*); | 64 void drawImage (const SkImage*, SkScalar,SkScalar, const SkPa
int*); |
65 void drawImageNine(const SkImage*, const SkIRect&, const SkRect&, const SkPa
int*); | 65 void drawImageNine(const SkImage*, const SkIRect&, const SkRect&, const SkPa
int*); |
66 void drawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPa
int*, | 66 void drawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPa
int*, |
67 SkCanvas::SrcRectConstraint); | 67 SkCanvas::SrcRectConstraint); |
68 void drawImageLattice(const SkImage*, const SkCanvas::Lattice&, const SkRect
&, const SkPaint*) | 68 void drawImageLattice(const SkImage*, const SkCanvas::Lattice&, const SkRect
&, const SkPaint*); |
69 {/*TODO*/} | |
70 | 69 |
71 void drawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], | 70 void drawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], |
72 SkXfermode*, const SkPaint&) {/*TODO*/} | 71 SkXfermode*, const SkPaint&) {/*TODO*/} |
73 void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint&
) {/*TODO*/} | 72 void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint&
); |
74 void drawVertices(SkCanvas::VertexMode, int, const SkPoint[], const SkPoint[
], const SkColor[], | 73 void drawVertices(SkCanvas::VertexMode, int, const SkPoint[], const SkPoint[
], const SkColor[], |
75 SkXfermode*, const uint16_t[], int, const SkPaint&) {/*TOD
O*/} | 74 SkXfermode*, const uint16_t[], int, const SkPaint&) {/*TOD
O*/} |
76 void drawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkCo
lor[], int, | 75 void drawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkCo
lor[], int, |
77 SkXfermode::Mode, const SkRect*, const SkPaint*) {/*TODO*/} | 76 SkXfermode::Mode, const SkRect*, const SkPaint*); |
78 | 77 |
79 private: | 78 private: |
80 SkLiteDL(); | 79 SkLiteDL(); |
81 ~SkLiteDL(); | 80 ~SkLiteDL(); |
82 | 81 |
83 void internal_dispose() const override; | 82 void internal_dispose() const override; |
84 | 83 |
85 SkRect onGetBounds() override; | 84 SkRect onGetBounds() override; |
86 void onDraw(SkCanvas*) override; | 85 void onDraw(SkCanvas*) override; |
87 | 86 |
88 SkLiteDL* fNext; | 87 SkLiteDL* fNext; |
89 SkRect fBounds; | 88 SkRect fBounds; |
90 SkTDArray<uint8_t> fBytes; | 89 SkTDArray<uint8_t> fBytes; |
91 }; | 90 }; |
92 | 91 |
93 #endif//SkLiteDL_DEFINED | 92 #endif//SkLiteDL_DEFINED |
OLD | NEW |