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

Side by Side Diff: src/utils/SkNWayCanvas.cpp

Issue 831253002: Revert of Revert of move remaining virtual draw methods to onDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/utils/SkLuaCanvas.cpp ('k') | src/utils/SkProxyCanvas.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkNWayCanvas.h" 8 #include "SkNWayCanvas.h"
9 9
10 SkNWayCanvas::SkNWayCanvas(int width, int height) 10 SkNWayCanvas::SkNWayCanvas(int width, int height)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 129 void SkNWayCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
130 Iter iter(fList); 130 Iter iter(fList);
131 while (iter.next()) { 131 while (iter.next()) {
132 iter->clipRegion(deviceRgn, op); 132 iter->clipRegion(deviceRgn, op);
133 } 133 }
134 this->INHERITED::onClipRegion(deviceRgn, op); 134 this->INHERITED::onClipRegion(deviceRgn, op);
135 } 135 }
136 136
137 void SkNWayCanvas::drawPaint(const SkPaint& paint) { 137 void SkNWayCanvas::onDrawPaint(const SkPaint& paint) {
138 Iter iter(fList); 138 Iter iter(fList);
139 while (iter.next()) { 139 while (iter.next()) {
140 iter->drawPaint(paint); 140 iter->drawPaint(paint);
141 } 141 }
142 } 142 }
143 143
144 void SkNWayCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], 144 void SkNWayCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[ ],
145 const SkPaint& paint) { 145 const SkPaint& paint) {
146 Iter iter(fList); 146 Iter iter(fList);
147 while (iter.next()) { 147 while (iter.next()) {
148 iter->drawPoints(mode, count, pts, paint); 148 iter->drawPoints(mode, count, pts, paint);
149 } 149 }
150 } 150 }
151 151
152 void SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { 152 void SkNWayCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
153 Iter iter(fList); 153 Iter iter(fList);
154 while (iter.next()) { 154 while (iter.next()) {
155 iter->drawRect(rect, paint); 155 iter->drawRect(rect, paint);
156 } 156 }
157 } 157 }
158 158
159 void SkNWayCanvas::drawOval(const SkRect& rect, const SkPaint& paint) { 159 void SkNWayCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
160 Iter iter(fList); 160 Iter iter(fList);
161 while (iter.next()) { 161 while (iter.next()) {
162 iter->drawOval(rect, paint); 162 iter->drawOval(rect, paint);
163 } 163 }
164 } 164 }
165 165
166 void SkNWayCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { 166 void SkNWayCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
167 Iter iter(fList); 167 Iter iter(fList);
168 while (iter.next()) { 168 while (iter.next()) {
169 iter->drawRRect(rrect, paint); 169 iter->drawRRect(rrect, paint);
170 } 170 }
171 } 171 }
172 172
173 void SkNWayCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, 173 void SkNWayCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
174 const SkPaint& paint) { 174 const SkPaint& paint) {
175 Iter iter(fList); 175 Iter iter(fList);
176 while (iter.next()) { 176 while (iter.next()) {
177 iter->drawDRRect(outer, inner, paint); 177 iter->drawDRRect(outer, inner, paint);
178 } 178 }
179 } 179 }
180 180
181 void SkNWayCanvas::drawPath(const SkPath& path, const SkPaint& paint) { 181 void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
182 Iter iter(fList); 182 Iter iter(fList);
183 while (iter.next()) { 183 while (iter.next()) {
184 iter->drawPath(path, paint); 184 iter->drawPath(path, paint);
185 } 185 }
186 } 186 }
187 187
188 void SkNWayCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, 188 void SkNWayCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
189 const SkPaint* paint) { 189 const SkPaint* paint) {
190 Iter iter(fList); 190 Iter iter(fList);
191 while (iter.next()) { 191 while (iter.next()) {
192 iter->drawBitmap(bitmap, x, y, paint); 192 iter->drawBitmap(bitmap, x, y, paint);
193 } 193 }
194 } 194 }
195 195
196 void SkNWayCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* sr c, 196 void SkNWayCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, c onst SkRect& dst,
197 const SkRect& dst, const SkPaint* paint, 197 const SkPaint* paint, DrawBitmapRectFlags fl ags) {
198 DrawBitmapRectFlags flags) {
199 Iter iter(fList); 198 Iter iter(fList);
200 while (iter.next()) { 199 while (iter.next()) {
201 iter->drawBitmapRectToRect(bitmap, src, dst, paint, flags); 200 iter->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
202 } 201 }
203 } 202 }
204 203
205 void SkNWayCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 204 void SkNWayCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cente r,
206 const SkRect& dst, const SkPaint* paint) { 205 const SkRect& dst, const SkPaint* paint) {
207 Iter iter(fList); 206 Iter iter(fList);
208 while (iter.next()) { 207 while (iter.next()) {
209 iter->drawBitmapNine(bitmap, center, dst, paint); 208 iter->drawBitmapNine(bitmap, center, dst, paint);
210 } 209 }
211 } 210 }
212 211
213 void SkNWayCanvas::drawImage(const SkImage* image, SkScalar left, SkScalar top, 212 void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top ,
214 const SkPaint* paint) { 213 const SkPaint* paint) {
215 Iter iter(fList); 214 Iter iter(fList);
216 while (iter.next()) { 215 while (iter.next()) {
217 iter->drawImage(image, left, top, paint); 216 iter->drawImage(image, left, top, paint);
218 } 217 }
219 } 218 }
220 219
221 void SkNWayCanvas::drawImageRect(const SkImage* image, const SkRect* src, 220 void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons t SkRect& dst,
222 const SkRect& dst, 221 const SkPaint* paint) {
223 const SkPaint* paint) {
224 Iter iter(fList); 222 Iter iter(fList);
225 while (iter.next()) { 223 while (iter.next()) {
226 iter->drawImageRect(image, src, dst, paint); 224 iter->drawImageRect(image, src, dst, paint);
227 } 225 }
228 } 226 }
229 227
230 void SkNWayCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, 228 void SkNWayCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPa int* paint) {
231 const SkPaint* paint) {
232 Iter iter(fList); 229 Iter iter(fList);
233 while (iter.next()) { 230 while (iter.next()) {
234 iter->drawSprite(bitmap, x, y, paint); 231 iter->drawSprite(bitmap, x, y, paint);
235 } 232 }
236 } 233 }
237 234
238 void SkNWayCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S kScalar y, 235 void SkNWayCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, S kScalar y,
239 const SkPaint& paint) { 236 const SkPaint& paint) {
240 Iter iter(fList); 237 Iter iter(fList);
241 while (iter.next()) { 238 while (iter.next()) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 273 }
277 274
278 void SkNWayCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri x, 275 void SkNWayCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matri x,
279 const SkPaint* paint) { 276 const SkPaint* paint) {
280 Iter iter(fList); 277 Iter iter(fList);
281 while (iter.next()) { 278 while (iter.next()) {
282 iter->drawPicture(picture, matrix, paint); 279 iter->drawPicture(picture, matrix, paint);
283 } 280 }
284 } 281 }
285 282
286 void SkNWayCanvas::drawVertices(VertexMode vmode, int vertexCount, 283 void SkNWayCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
287 const SkPoint vertices[], const SkPoint texs[], 284 const SkPoint vertices[], const SkPoint texs[] ,
288 const SkColor colors[], SkXfermode* xmode, 285 const SkColor colors[], SkXfermode* xmode,
289 const uint16_t indices[], int indexCount, 286 const uint16_t indices[], int indexCount,
290 const SkPaint& paint) { 287 const SkPaint& paint) {
291 Iter iter(fList); 288 Iter iter(fList);
292 while (iter.next()) { 289 while (iter.next()) {
293 iter->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode, 290 iter->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
294 indices, indexCount, paint); 291 indices, indexCount, paint);
295 } 292 }
296 } 293 }
297 294
298 void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4] , 295 void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4] ,
299 const SkPoint texCoords[4], SkXfermode* xmode, 296 const SkPoint texCoords[4], SkXfermode* xmode,
300 const SkPaint& paint) { 297 const SkPaint& paint) {
(...skipping 24 matching lines...) Expand all
325 iter->addComment(kywd, value); 322 iter->addComment(kywd, value);
326 } 323 }
327 } 324 }
328 325
329 void SkNWayCanvas::endCommentGroup() { 326 void SkNWayCanvas::endCommentGroup() {
330 Iter iter(fList); 327 Iter iter(fList);
331 while (iter.next()) { 328 while (iter.next()) {
332 iter->endCommentGroup(); 329 iter->endCommentGroup();
333 } 330 }
334 } 331 }
OLDNEW
« no previous file with comments | « src/utils/SkLuaCanvas.cpp ('k') | src/utils/SkProxyCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698