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

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: 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
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | tests/PictureTest.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 #include "GrRecordReplaceDraw.h" 8 #include "GrRecordReplaceDraw.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Used by GrRecordReplaceDraw. It intercepts nested drawPicture calls and 53 // Used by GrRecordReplaceDraw. It intercepts nested drawPicture calls and
54 // also draws them with replaced layers. 54 // also draws them with replaced layers.
55 class ReplaceDraw : public SkRecords::Draw { 55 class ReplaceDraw : public SkRecords::Draw {
56 public: 56 public:
57 ReplaceDraw(SkCanvas* canvas, 57 ReplaceDraw(SkCanvas* canvas,
58 SkPicture const* const drawablePicts[], int drawableCount, 58 SkPicture const* const drawablePicts[], int drawableCount,
59 const SkPicture* picture, 59 const SkPicture* picture,
60 const GrReplacements* replacements, 60 const GrReplacements* replacements,
61 const SkMatrix& initialMatrix, 61 const SkMatrix& initialMatrix,
62 SkDrawPictureCallback* callback) 62 SkDrawPictureCallback* callback)
63 : INHERITED(canvas, drawablePicts, drawableCount) 63 : INHERITED(canvas, drawablePicts, NULL, drawableCount)
64 , fCanvas(canvas) 64 , fCanvas(canvas)
65 , fPicture(picture) 65 , fPicture(picture)
66 , fReplacements(replacements) 66 , fReplacements(replacements)
67 , fInitialMatrix(initialMatrix) 67 , fInitialMatrix(initialMatrix)
68 , fCallback(callback) 68 , fCallback(callback)
69 , fIndex(0) 69 , fIndex(0)
70 , fNumReplaced(0) { 70 , fNumReplaced(0) {
71 } 71 }
72 72
73 int draw() { 73 int draw() {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const GrReplacements* replacements, 181 const GrReplacements* replacements,
182 const SkMatrix& initialMatrix, 182 const SkMatrix& initialMatrix,
183 SkDrawPictureCallback* callback) { 183 SkDrawPictureCallback* callback) {
184 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); 184 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
185 185
186 // TODO: drawablePicts? 186 // TODO: drawablePicts?
187 ReplaceDraw draw(canvas, NULL, 0, picture, replacements, initialMatrix, call back); 187 ReplaceDraw draw(canvas, NULL, 0, picture, replacements, initialMatrix, call back);
188 188
189 return draw.draw(); 189 return draw.draw();
190 } 190 }
OLDNEW
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698