| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |