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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |