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

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

Issue 689673003: SkTaskGroup::batch(fn, args, N) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pun fn pointers Created 6 years, 1 month 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 | « dm/DMQuiltTask.cpp ('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
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 SkMultiPictureDraw_DEFINED 8 #ifndef SkMultiPictureDraw_DEFINED
9 #define SkMultiPictureDraw_DEFINED 9 #define SkMultiPictureDraw_DEFINED
10 10
(...skipping 22 matching lines...) Expand all
33 /** 33 /**
34 * Add a canvas/picture pair for later rendering. 34 * Add a canvas/picture pair for later rendering.
35 * @param canvas the canvas in which to draw picture 35 * @param canvas the canvas in which to draw picture
36 * @param picture the picture to draw into canvas 36 * @param picture the picture to draw into canvas
37 * @param matrix if non-NULL, applied to the CTM when drawing 37 * @param matrix if non-NULL, applied to the CTM when drawing
38 * @param paint if non-NULL, draw picture to a temporary buffer 38 * @param paint if non-NULL, draw picture to a temporary buffer
39 * and then apply the paint when the result is drawn 39 * and then apply the paint when the result is drawn
40 */ 40 */
41 void add(SkCanvas* canvas, 41 void add(SkCanvas* canvas,
42 const SkPicture* picture, 42 const SkPicture* picture,
43 const SkMatrix* matrix = NULL, 43 const SkMatrix* matrix = NULL,
44 const SkPaint* paint = NULL); 44 const SkPaint* paint = NULL);
45 45
46 /** 46 /**
47 * Perform all the previously added draws. This will reset the state 47 * Perform all the previously added draws. This will reset the state
48 * of this object. 48 * of this object.
49 */ 49 */
50 void draw(); 50 void draw();
51 51
52 /** 52 /**
53 * Abandon all buffered draws and reset to the initial state. 53 * Abandon all buffered draws and reset to the initial state.
54 */ 54 */
55 void reset(); 55 void reset();
56 56
57 private: 57 private:
58 struct DrawData { 58 struct DrawData {
59 SkCanvas* fCanvas; // reffed 59 SkCanvas* fCanvas; // reffed
60 const SkPicture* fPicture; // reffed 60 const SkPicture* fPicture; // reffed
61 SkMatrix fMatrix; 61 SkMatrix fMatrix;
62 SkPaint* fPaint; // owned 62 SkPaint* fPaint; // owned
63 63
64 void init(SkCanvas*, const SkPicture*, const SkMatrix*, const SkPaint*); 64 void init(SkCanvas*, const SkPicture*, const SkMatrix*, const SkPaint*);
65 void draw(); 65 void draw();
66 66
67 static void Reset(SkTDArray<DrawData>&); 67 static void Reset(SkTDArray<DrawData>&);
68 68
69 static void Run(void* ctx) { 69 static void Draw(DrawData* d) { d->draw(); }
70 static_cast<DrawData*>(ctx)->draw();
71 }
72 }; 70 };
73 71
74 SkTDArray<DrawData> fThreadSafeDrawData; 72 SkTDArray<DrawData> fThreadSafeDrawData;
75 SkTDArray<DrawData> fGPUDrawData; 73 SkTDArray<DrawData> fGPUDrawData;
76 }; 74 };
77 75
78 #endif 76 #endif
OLDNEW
« no previous file with comments | « dm/DMQuiltTask.cpp ('k') | src/core/SkMultiPictureDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698