OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkLiteRecorder_DEFINED |
| 9 #define SkLiteRecorder_DEFINED |
| 10 |
| 11 #include "SkCanvas.h" |
| 12 |
| 13 class SkLiteDL; |
| 14 |
| 15 class SkLiteRecorder final : public SkCanvas { |
| 16 public: |
| 17 SkLiteRecorder(); |
| 18 void reset(SkLiteDL*); |
| 19 |
| 20 sk_sp<SkSurface> onNewSurface(const SkImageInfo&, const SkSurfaceProps&) ove
rride; |
| 21 |
| 22 void willSave() override; |
| 23 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override; |
| 24 void willRestore() override; |
| 25 |
| 26 void didConcat(const SkMatrix&) override; |
| 27 void didSetMatrix(const SkMatrix&) override; |
| 28 |
| 29 void onClipRect (const SkRect&, SkRegion::Op, ClipEdgeStyle) override; |
| 30 void onClipRRect (const SkRRect&, SkRegion::Op, ClipEdgeStyle) override; |
| 31 void onClipPath (const SkPath&, SkRegion::Op, ClipEdgeStyle) override; |
| 32 void onClipRegion(const SkRegion&, SkRegion::Op) override; |
| 33 |
| 34 void onDrawPaint (const SkPaint&) override; |
| 35 void onDrawPath (const SkPath&, const SkPaint&) override; |
| 36 void onDrawRect (const SkRect&, const SkPaint&) override; |
| 37 void onDrawOval (const SkRect&, const SkPaint&) override; |
| 38 void onDrawRRect (const SkRRect&, const SkPaint&) override; |
| 39 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; |
| 40 |
| 41 void onDrawDrawable(SkDrawable*, const SkMatrix*) override; |
| 42 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) overri
de; |
| 43 void onDrawAnnotation(const SkRect&, const char[], SkData*) override; |
| 44 |
| 45 void onDrawText (const void*, size_t, SkScalar x, SkScalar y, const SkP
aint&) override; |
| 46 void onDrawPosText (const void*, size_t, const SkPoint[], const SkPaint&)
override; |
| 47 void onDrawPosTextH (const void*, size_t, const SkScalar[], SkScalar, const
SkPaint&) override; |
| 48 void onDrawTextOnPath(const void*, size_t, |
| 49 const SkPath&, const SkMatrix*, const SkPaint&) overri
de; |
| 50 void onDrawTextRSXform(const void*, size_t, |
| 51 const SkRSXform[], const SkRect*, const SkPaint&) ove
rride; |
| 52 void onDrawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&) o
verride; |
| 53 |
| 54 void onDrawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint*) overr
ide; |
| 55 void onDrawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&, const
SkPaint*) override; |
| 56 void onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const S
kPaint*, |
| 57 SrcRectConstraint) override; |
| 58 |
| 59 void onDrawImage(const SkImage*, SkScalar, SkScalar, const SkPaint*) overrid
e; |
| 60 void onDrawImageLattice(const SkImage*, const Lattice&, const SkRect&, const
SkPaint*) override; |
| 61 void onDrawImageNine(const SkImage*, const SkIRect&, const SkRect&, const Sk
Paint*) override; |
| 62 void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkP
aint*, |
| 63 SrcRectConstraint) override; |
| 64 |
| 65 void onDrawPatch(const SkPoint[12], const SkColor[4], |
| 66 const SkPoint[4], SkXfermode*, const SkPaint&) override; |
| 67 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain
t&) override; |
| 68 void onDrawVertices(VertexMode, int, const SkPoint[], const SkPoint[], const
SkColor[], |
| 69 SkXfermode*, const uint16_t[], int, const SkPaint&) over
ride; |
| 70 void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const Sk
Color[], |
| 71 int, SkXfermode::Mode, const SkRect*, const SkPaint*) overr
ide; |
| 72 |
| 73 #ifdef SK_EXPERIMENTAL_SHADOWING |
| 74 void didTranslateZ(SkScalar) override; |
| 75 void onDrawShadowedPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) override; |
| 76 #else |
| 77 void didTranslateZ(SkScalar); |
| 78 void onDrawShadowedPicture(const SkPicture*, const SkMatrix*, const SkPaint*
); |
| 79 #endif |
| 80 |
| 81 private: |
| 82 SkLiteDL* fDL; |
| 83 }; |
| 84 |
| 85 #endif//SkLiteRecorder_DEFINED |
OLD | NEW |