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

Side by Side Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 789033002: Remove SkCanvas::drawBitmapMatrix() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: non-const canvas ptr Created 6 years 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/debugger/SkDrawCommand.h ('k') | tests/PictureTest.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 2012 Google Inc. 3 * Copyright 2012 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 8
9 9
10 #include "SkDrawCommand.h" 10 #include "SkDrawCommand.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 void SkDrawBitmapCommand::execute(SkCanvas* canvas) const { 294 void SkDrawBitmapCommand::execute(SkCanvas* canvas) const {
295 canvas->drawBitmap(fBitmap, fLeft, fTop, fPaintPtr); 295 canvas->drawBitmap(fBitmap, fLeft, fTop, fPaintPtr);
296 } 296 }
297 297
298 bool SkDrawBitmapCommand::render(SkCanvas* canvas) const { 298 bool SkDrawBitmapCommand::render(SkCanvas* canvas) const {
299 render_bitmap(canvas, fBitmap); 299 render_bitmap(canvas, fBitmap);
300 return true; 300 return true;
301 } 301 }
302 302
303 SkDrawBitmapMatrixCommand::SkDrawBitmapMatrixCommand(const SkBitmap& bitmap,
304 const SkMatrix& matrix,
305 const SkPaint* paint)
306 : INHERITED(DRAW_BITMAP_MATRIX) {
307 fBitmap = bitmap;
308 fMatrix = matrix;
309 if (paint) {
310 fPaint = *paint;
311 fPaintPtr = &fPaint;
312 } else {
313 fPaintPtr = NULL;
314 }
315
316 fInfo.push(SkObjectParser::BitmapToString(bitmap));
317 fInfo.push(SkObjectParser::MatrixToString(matrix));
318 if (paint) {
319 fInfo.push(SkObjectParser::PaintToString(*paint));
320 }
321 }
322
323 void SkDrawBitmapMatrixCommand::execute(SkCanvas* canvas) const {
324 canvas->drawBitmapMatrix(fBitmap, fMatrix, fPaintPtr);
325 }
326
327 bool SkDrawBitmapMatrixCommand::render(SkCanvas* canvas) const {
328 render_bitmap(canvas, fBitmap);
329 return true;
330 }
331
332 SkDrawBitmapNineCommand::SkDrawBitmapNineCommand(const SkBitmap& bitmap, const S kIRect& center, 303 SkDrawBitmapNineCommand::SkDrawBitmapNineCommand(const SkBitmap& bitmap, const S kIRect& center,
333 const SkRect& dst, const SkPain t* paint) 304 const SkRect& dst, const SkPain t* paint)
334 : INHERITED(DRAW_BITMAP_NINE) { 305 : INHERITED(DRAW_BITMAP_NINE) {
335 fBitmap = bitmap; 306 fBitmap = bitmap;
336 fCenter = center; 307 fCenter = center;
337 fDst = dst; 308 fDst = dst;
338 if (paint) { 309 if (paint) {
339 fPaint = *paint; 310 fPaint = *paint;
340 fPaintPtr = &fPaint; 311 fPaintPtr = &fPaint;
341 } else { 312 } else {
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 p.setColor(SK_ColorCYAN); 989 p.setColor(SK_ColorCYAN);
1019 p.setStyle(SkPaint::kStroke_Style); 990 p.setStyle(SkPaint::kStroke_Style);
1020 canvas->drawRect(fCullRect, p); 991 canvas->drawRect(fCullRect, p);
1021 } 992 }
1022 993
1023 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } 994 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { }
1024 995
1025 void SkPopCullCommand::execute(SkCanvas* canvas) const { 996 void SkPopCullCommand::execute(SkCanvas* canvas) const {
1026 canvas->popCull(); 997 canvas->popCull();
1027 } 998 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDrawCommand.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698