OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkRecorder_DEFINED | 8 #ifndef SkRecorder_DEFINED |
9 #define SkRecorder_DEFINED | 9 #define SkRecorder_DEFINED |
10 | 10 |
11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
12 #include "SkRecord.h" | 12 #include "SkRecord.h" |
13 #include "SkRecords.h" | 13 #include "SkRecords.h" |
14 #include "SkTDArray.h" | 14 #include "SkTDArray.h" |
15 | 15 |
16 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. | 16 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. |
17 | 17 |
18 class SkRecorder : public SkCanvas { | 18 class SkRecorder : public SkCanvas { |
19 public: | 19 public: |
20 // Does not take ownership of the SkRecord. | 20 // Does not take ownership of the SkRecord. |
21 SkRecorder(SkRecord*, int width, int height); // legacy version | 21 SkRecorder(SkRecord*, int width, int height); // legacy version |
22 SkRecorder(SkRecord*, const SkRect& bounds); | 22 SkRecorder(SkRecord*, const SkRect& bounds); |
23 virtual ~SkRecorder() SK_OVERRIDE; | 23 virtual ~SkRecorder() SK_OVERRIDE; |
24 | 24 |
25 // return a (new or ref'd) data containing the array of pictures that were | 25 // Return a new or ref'd array of pictures that were snapped from our drawab
les. |
26 // snapped from our drawables. | 26 SkPicture::SnapshotArray* newDrawableSnapshot(SkBBHFactory*, uint32_t record
Flags); |
27 SkData* newDrawableSnapshot(SkBBHFactory*, uint32_t recordFlags); | |
28 | 27 |
29 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. | 28 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor
der will fail. |
30 void forgetRecord(); | 29 void forgetRecord(); |
31 | 30 |
32 void clear(SkColor) SK_OVERRIDE; | 31 void clear(SkColor) SK_OVERRIDE; |
33 void drawPaint(const SkPaint& paint) SK_OVERRIDE; | 32 void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
34 void drawPoints(PointMode mode, | 33 void drawPoints(PointMode mode, |
35 size_t count, | 34 size_t count, |
36 const SkPoint pts[], | 35 const SkPoint pts[], |
37 const SkPaint& paint) SK_OVERRIDE; | 36 const SkPaint& paint) SK_OVERRIDE; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 142 } |
144 | 143 |
145 SkRecord* fRecord; | 144 SkRecord* fRecord; |
146 | 145 |
147 int fSaveLayerCount; | 146 int fSaveLayerCount; |
148 SkTDArray<SkBool8> fSaveIsSaveLayer; | 147 SkTDArray<SkBool8> fSaveIsSaveLayer; |
149 SkTDArray<SkCanvasDrawable*> fDrawableList; | 148 SkTDArray<SkCanvasDrawable*> fDrawableList; |
150 }; | 149 }; |
151 | 150 |
152 #endif//SkRecorder_DEFINED | 151 #endif//SkRecorder_DEFINED |
OLD | NEW |