| 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 "GrContext.h" | 8 #include "GrContext.h" |
| 9 #include "GrLayerCache.h" | 9 #include "GrLayerCache.h" |
| 10 #include "GrRecordReplaceDraw.h" | 10 #include "GrRecordReplaceDraw.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 SkRect query = { 0, 0, 0, 0 }; | 92 SkRect query = { 0, 0, 0, 0 }; |
| 93 (void)fCanvas->getClipBounds(&query); | 93 (void)fCanvas->getClipBounds(&query); |
| 94 | 94 |
| 95 bbh->search(query, &fOps); | 95 bbh->search(query, &fOps); |
| 96 | 96 |
| 97 for (fIndex = 0; fIndex < fOps.count(); ++fIndex) { | 97 for (fIndex = 0; fIndex < fOps.count(); ++fIndex) { |
| 98 if (fCallback && fCallback->abort()) { | 98 if (fCallback && fCallback->abort()) { |
| 99 return fNumReplaced; | 99 return fNumReplaced; |
| 100 } | 100 } |
| 101 | 101 |
| 102 record->visit<void>(fOps[fIndex], *this); | 102 record->visit(fOps[fIndex], *this); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } else { | 105 } else { |
| 106 for (fIndex = 0; fIndex < (int) record->count(); ++fIndex) { | 106 for (fIndex = 0; fIndex < (int) record->count(); ++fIndex) { |
| 107 if (fCallback && fCallback->abort()) { | 107 if (fCallback && fCallback->abort()) { |
| 108 return fNumReplaced; | 108 return fNumReplaced; |
| 109 } | 109 } |
| 110 | 110 |
| 111 record->visit<void>(fIndex, *this); | 111 record->visit(fIndex, *this); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 return fNumReplaced; | 115 return fNumReplaced; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Same as Draw for all ops except DrawPicture and SaveLayer. | 118 // Same as Draw for all ops except DrawPicture and SaveLayer. |
| 119 template <typename T> void operator()(const T& r) { | 119 template <typename T> void operator()(const T& r) { |
| 120 this->INHERITED::operator()(r); | 120 this->INHERITED::operator()(r); |
| 121 } | 121 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ReplaceDraw draw(canvas, layerCache, nullptr, 0, | 217 ReplaceDraw draw(canvas, layerCache, nullptr, 0, |
| 218 bp, bp, | 218 bp, bp, |
| 219 initialMatrix, callback, nullptr, 0); | 219 initialMatrix, callback, nullptr, 0); |
| 220 return draw.draw(); | 220 return draw.draw(); |
| 221 } else { | 221 } else { |
| 222 // TODO: can we assume / assert this doesn't happen? | 222 // TODO: can we assume / assert this doesn't happen? |
| 223 picture->playback(canvas, callback); | 223 picture->playback(canvas, callback); |
| 224 return 0; | 224 return 0; |
| 225 } | 225 } |
| 226 } | 226 } |
| OLD | NEW |