OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2014 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 SkMultiPictureDraw_DEFINED | |
9 #define SkMultiPictureDraw_DEFINED | |
10 | |
11 #include "SkTDArray.h" | |
12 | |
13 class SkCanvas; | |
14 class SkPicture; | |
15 | |
16 /** \class SkMultiPictureDraw | |
17 | |
18 The MultiPictureDraw object accepts several picture/canvas pairs and | |
19 then attempts to optimally draw the pictures into the canvases, sharing | |
20 as many resources as possible. | |
21 */ | |
22 class SkMultiPictureDraw { | |
23 public: | |
24 SkMultiPictureDraw(int sizeHint = 0); | |
25 ~SkMultiPictureDraw() { this->unrefAll(); } | |
26 | |
27 void add(const SkPicture* picture, | |
28 SkCanvas* canvas, | |
29 const SkMatrix* matrix = NULL); | |
30 | |
31 void add(const SkPicture* picture, | |
32 SkCanvas* canvas, | |
33 const SkRect& clipRect, | |
34 const SkMatrix* matrix = NULL); | |
35 | |
36 void add(const SkPicture* picture, | |
bsalomon
2014/08/21 14:49:32
Do we really need this?
| |
37 SkCanvas* canvas, | |
38 const SkRRect& clipRRect, | |
39 const SkMatrix* matrix = NULL); | |
40 | |
41 void draw(); | |
42 | |
43 private: | |
44 struct DrawData { | |
45 const SkPicture* pic; | |
46 SkCanvas* canvas; | |
47 SkMatrix matrix; | |
48 | |
49 enum ClipType { | |
50 kNone_ClipType, | |
51 kRect_ClipType, | |
52 kRRect_ClipType | |
53 }; | |
54 | |
55 SkRRect clipRRect; // also stores clipRect | |
56 ClipType clipType; | |
bsalomon
2014/08/21 14:49:32
Doesn't rrect know if it's a rect?
| |
57 }; | |
58 | |
59 SkTDArray<DrawData> fDrawData; | |
60 | |
61 void unrefAll(); | |
62 }; | |
63 | |
64 #endif | |
OLD | NEW |