Index: include/core/SkMultiPictureDraw.h |
diff --git a/include/core/SkMultiPictureDraw.h b/include/core/SkMultiPictureDraw.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d87ca6809d9e3f775ba3e6bcebe103c729f125c0 |
--- /dev/null |
+++ b/include/core/SkMultiPictureDraw.h |
@@ -0,0 +1,64 @@ |
+/* |
+ * Copyright 2014 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef SkMultiPictureDraw_DEFINED |
+#define SkMultiPictureDraw_DEFINED |
+ |
+#include "SkTDArray.h" |
+ |
+class SkCanvas; |
+class SkPicture; |
+ |
+/** \class SkMultiPictureDraw |
+ |
+ The MultiPictureDraw object accepts several picture/canvas pairs and |
+ then attempts to optimally draw the pictures into the canvases, sharing |
+ as many resources as possible. |
+*/ |
+class SkMultiPictureDraw { |
+public: |
+ SkMultiPictureDraw(int sizeHint = 0); |
+ ~SkMultiPictureDraw() { this->unrefAll(); } |
+ |
+ void add(const SkPicture* picture, |
+ SkCanvas* canvas, |
+ const SkMatrix* matrix = NULL); |
+ |
+ void add(const SkPicture* picture, |
+ SkCanvas* canvas, |
+ const SkRect& clipRect, |
+ const SkMatrix* matrix = NULL); |
+ |
+ void add(const SkPicture* picture, |
bsalomon
2014/08/21 14:49:32
Do we really need this?
|
+ SkCanvas* canvas, |
+ const SkRRect& clipRRect, |
+ const SkMatrix* matrix = NULL); |
+ |
+ void draw(); |
+ |
+private: |
+ struct DrawData { |
+ const SkPicture* pic; |
+ SkCanvas* canvas; |
+ SkMatrix matrix; |
+ |
+ enum ClipType { |
+ kNone_ClipType, |
+ kRect_ClipType, |
+ kRRect_ClipType |
+ }; |
+ |
+ SkRRect clipRRect; // also stores clipRect |
+ ClipType clipType; |
bsalomon
2014/08/21 14:49:32
Doesn't rrect know if it's a rect?
|
+ }; |
+ |
+ SkTDArray<DrawData> fDrawData; |
+ |
+ void unrefAll(); |
+}; |
+ |
+#endif |