| 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 void makeThreadsafe(); |
| 25 | 26 |
| 26 void save(); | 27 void save(); |
| 27 void saveLayer(const SkRect*, const SkPaint*, const SkImageFilter*, SkCanvas
::SaveLayerFlags); | 28 void saveLayer(const SkRect*, const SkPaint*, const SkImageFilter*, SkCanvas
::SaveLayerFlags); |
| 28 void restore(); | 29 void restore(); |
| 29 | 30 |
| 30 void concat (const SkMatrix&); | 31 void concat (const SkMatrix&); |
| 31 void setMatrix (const SkMatrix&); | 32 void setMatrix (const SkMatrix&); |
| 32 void translateZ(SkScalar); | 33 void translateZ(SkScalar); |
| 33 | 34 |
| 34 void clipPath (const SkPath&, SkRegion::Op, bool aa); | 35 void clipPath (const SkPath&, SkRegion::Op, bool aa); |
| 35 void clipRect (const SkRect&, SkRegion::Op, bool aa); | 36 void clipRect (const SkRect&, SkRegion::Op, bool aa); |
| 36 void clipRRect (const SkRRect&, SkRegion::Op, bool aa); | 37 void clipRRect (const SkRRect&, SkRegion::Op, bool aa); |
| 37 void clipRegion(const SkRegion&, SkRegion::Op); | 38 void clipRegion(const SkRegion&, SkRegion::Op); |
| 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*); | 47 void drawAnnotation (const SkRect&, const char*, SkData*); |
| 48 void drawDrawable (SkDrawable*, const SkMatrix*); | 48 void drawDrawable (SkDrawable*, const SkMatrix*); |
| 49 void drawPicture (const SkPicture*, const SkMatrix*, const SkPaint*); | 49 void drawPicture (const SkPicture*, const SkMatrix*, const SkPaint*); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 | 69 |
| 70 void drawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], | 70 void drawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], |
| 71 SkXfermode*, const SkPaint&) {/*TODO*/} | 71 SkXfermode*, const SkPaint&); |
| 72 void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint&
); | 72 void drawPoints(SkCanvas::PointMode, size_t, const SkPoint[], const SkPaint&
); |
| 73 void drawVertices(SkCanvas::VertexMode, int, const SkPoint[], const SkPoint[
], const SkColor[], | 73 void drawVertices(SkCanvas::VertexMode, int, const SkPoint[], const SkPoint[
], const SkColor[], |
| 74 SkXfermode*, const uint16_t[], int, const SkPaint&) {/*TOD
O*/} | 74 SkXfermode*, const uint16_t[], int, const SkPaint&); |
| 75 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, |
| 76 SkXfermode::Mode, const SkRect*, const SkPaint*); | 76 SkXfermode::Mode, const SkRect*, const SkPaint*); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 SkLiteDL(); | 79 SkLiteDL(); |
| 80 ~SkLiteDL(); | 80 ~SkLiteDL(); |
| 81 | 81 |
| 82 void internal_dispose() const override; | 82 void internal_dispose() const override; |
| 83 | 83 |
| 84 SkRect onGetBounds() override; | 84 SkRect onGetBounds() override; |
| 85 void onDraw(SkCanvas*) override; | 85 void onDraw(SkCanvas*) override; |
| 86 | 86 |
| 87 SkLiteDL* fNext; | 87 SkLiteDL* fNext; |
| 88 SkRect fBounds; | 88 SkRect fBounds; |
| 89 SkTDArray<uint8_t> fBytes; | 89 SkTDArray<uint8_t> fBytes; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 #endif//SkLiteDL_DEFINED | 92 #endif//SkLiteDL_DEFINED |
| OLD | NEW |