OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |