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

Side by Side Diff: src/gpu/GrRecordReplaceDraw.cpp

Issue 732653004: option to return drawable from recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: plumb pictlist down to layer hoister Created 6 years 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
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 #include "GrRecordReplaceDraw.h" 8 #include "GrRecordReplaceDraw.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // Used by GrRecordReplaceDraw. It intercepts nested drawPicture calls and 54 // Used by GrRecordReplaceDraw. It intercepts nested drawPicture calls and
55 // also draws them with replaced layers. 55 // also draws them with replaced layers.
56 class ReplaceDraw : public SkRecords::Draw { 56 class ReplaceDraw : public SkRecords::Draw {
57 public: 57 public:
58 ReplaceDraw(SkCanvas* canvas, 58 ReplaceDraw(SkCanvas* canvas,
59 SkPicture const* const drawablePicts[], int drawableCount, 59 SkPicture const* const drawablePicts[], int drawableCount,
60 const SkPicture* picture, 60 const SkPicture* picture,
61 const GrReplacements* replacements, 61 const GrReplacements* replacements,
62 const SkMatrix& initialMatrix, 62 const SkMatrix& initialMatrix,
63 SkDrawPictureCallback* callback) 63 SkDrawPictureCallback* callback)
64 : INHERITED(canvas, drawablePicts, drawableCount) 64 : INHERITED(canvas, drawablePicts, NULL, drawableCount)
65 , fCanvas(canvas) 65 , fCanvas(canvas)
66 , fPicture(picture) 66 , fPicture(picture)
67 , fReplacements(replacements) 67 , fReplacements(replacements)
68 , fInitialMatrix(initialMatrix) 68 , fInitialMatrix(initialMatrix)
69 , fCallback(callback) 69 , fCallback(callback)
70 , fIndex(0) 70 , fIndex(0)
71 , fNumReplaced(0) { 71 , fNumReplaced(0) {
72 } 72 }
73 73
74 int draw() { 74 int draw() {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 const GrReplacements* replacements, 182 const GrReplacements* replacements,
183 const SkMatrix& initialMatrix, 183 const SkMatrix& initialMatrix,
184 SkDrawPictureCallback* callback) { 184 SkDrawPictureCallback* callback) {
185 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); 185 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
186 186
187 // TODO: drawablePicts? 187 // TODO: drawablePicts?
188 ReplaceDraw draw(canvas, NULL, 0, picture, replacements, initialMatrix, call back); 188 ReplaceDraw draw(canvas, NULL, 0, picture, replacements, initialMatrix, call back);
189 189
190 return draw.draw(); 190 return draw.draw();
191 } 191 }
OLDNEW
« src/core/SkRecordDraw.cpp ('K') | « src/core/SkRecorder.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698