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

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

Issue 1824983003: SkRecord: infer return type for visit() and mutate(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months 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/SkRecordPattern.h ('k') | tests/RecordTest.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 "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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkRecordPattern.h ('k') | tests/RecordTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698