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