Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: include/core/SkMultiPictureDraw.h

Issue 491313003: SkMultiPictureDraw API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/gmslides.gypi ('k') | src/core/SkMultiPictureDraw.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « gyp/gmslides.gypi ('k') | src/core/SkMultiPictureDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698