blob: 92b425b5281d451851283bfdc290516b9e18697b [file] [log] [blame]
mtklein9c5052f2016-08-06 12:51:51 -07001/*
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
Florin Malita439ace92016-12-02 12:05:41 -050011#include "SkNoDrawCanvas.h"
mtklein9c5052f2016-08-06 12:51:51 -070012
13class SkLiteDL;
14
Florin Malita439ace92016-12-02 12:05:41 -050015class SkLiteRecorder final : public SkNoDrawCanvas {
mtklein9c5052f2016-08-06 12:51:51 -070016public:
17 SkLiteRecorder();
Derek Sollenbergerd7875f52017-03-01 15:33:23 -050018 void reset(SkLiteDL*, const SkIRect& bounds);
mtklein9c5052f2016-08-06 12:51:51 -070019
20 sk_sp<SkSurface> onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override;
21
reed6ae69692016-09-02 04:56:53 -070022#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
23 SkDrawFilter* setDrawFilter(SkDrawFilter*) override;
24#endif
25
mtklein9c5052f2016-08-06 12:51:51 -070026 void willSave() override;
27 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override;
28 void willRestore() override;
29
Mike Klein7cc49d62017-08-14 10:39:28 -040030 void onFlush() override;
31
mtklein9c5052f2016-08-06 12:51:51 -070032 void didConcat(const SkMatrix&) override;
33 void didSetMatrix(const SkMatrix&) override;
mtkleincbdf0072016-08-19 09:05:27 -070034 void didTranslate(SkScalar, SkScalar) override;
mtklein9c5052f2016-08-06 12:51:51 -070035
Mike Reedc1f77742016-12-09 09:00:50 -050036 void onClipRect (const SkRect&, SkClipOp, ClipEdgeStyle) override;
37 void onClipRRect (const SkRRect&, SkClipOp, ClipEdgeStyle) override;
38 void onClipPath (const SkPath&, SkClipOp, ClipEdgeStyle) override;
39 void onClipRegion(const SkRegion&, SkClipOp) override;
mtklein9c5052f2016-08-06 12:51:51 -070040
41 void onDrawPaint (const SkPaint&) override;
msarett44df6512016-08-25 13:54:30 -070042 void onDrawPath (const SkPath&, const SkPaint&) override;
43 void onDrawRect (const SkRect&, const SkPaint&) override;
44 void onDrawRegion(const SkRegion&, const SkPaint&) override;
45 void onDrawOval (const SkRect&, const SkPaint&) override;
bsalomonac3aa242016-08-19 11:25:19 -070046 void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override;
mtklein9c5052f2016-08-06 12:51:51 -070047 void onDrawRRect (const SkRRect&, const SkPaint&) override;
48 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
49
50 void onDrawDrawable(SkDrawable*, const SkMatrix*) override;
51 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
52 void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
53
54 void onDrawText (const void*, size_t, SkScalar x, SkScalar y, const SkPaint&) override;
55 void onDrawPosText (const void*, size_t, const SkPoint[], const SkPaint&) override;
56 void onDrawPosTextH (const void*, size_t, const SkScalar[], SkScalar, const SkPaint&) override;
57 void onDrawTextOnPath(const void*, size_t,
58 const SkPath&, const SkMatrix*, const SkPaint&) override;
59 void onDrawTextRSXform(const void*, size_t,
60 const SkRSXform[], const SkRect*, const SkPaint&) override;
61 void onDrawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&) override;
62
63 void onDrawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint*) override;
msarett16882062016-08-16 09:31:08 -070064 void onDrawBitmapLattice(const SkBitmap&, const Lattice&, const SkRect&,
65 const SkPaint*) override;
mtklein9c5052f2016-08-06 12:51:51 -070066 void onDrawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&, const SkPaint*) override;
67 void onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint*,
68 SrcRectConstraint) override;
69
70 void onDrawImage(const SkImage*, SkScalar, SkScalar, const SkPaint*) override;
71 void onDrawImageLattice(const SkImage*, const Lattice&, const SkRect&, const SkPaint*) override;
72 void onDrawImageNine(const SkImage*, const SkIRect&, const SkRect&, const SkPaint*) override;
73 void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
74 SrcRectConstraint) override;
75
76 void onDrawPatch(const SkPoint[12], const SkColor[4],
Mike Reedfaba3712016-11-03 14:45:31 -040077 const SkPoint[4], SkBlendMode, const SkPaint&) override;
mtklein9c5052f2016-08-06 12:51:51 -070078 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
Mike Reede88a1cb2017-03-17 09:50:46 -040079 void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
mtklein9c5052f2016-08-06 12:51:51 -070080 void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],
Mike Reedfaba3712016-11-03 14:45:31 -040081 int, SkBlendMode, const SkRect*, const SkPaint*) override;
Mike Reed4204da22017-05-17 08:53:36 -040082 void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
mtklein9c5052f2016-08-06 12:51:51 -070083
mtklein9c5052f2016-08-06 12:51:51 -070084private:
Florin Malita439ace92016-12-02 12:05:41 -050085 typedef SkNoDrawCanvas INHERITED;
86
mtklein9c5052f2016-08-06 12:51:51 -070087 SkLiteDL* fDL;
88};
89
90#endif//SkLiteRecorder_DEFINED