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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 return true; | 380 return true; |
381 } | 381 } |
382 | 382 |
383 SkDrawImageCommand::SkDrawImageCommand(const SkImage* image, SkScalar left, SkSc
alar top, | 383 SkDrawImageCommand::SkDrawImageCommand(const SkImage* image, SkScalar left, SkSc
alar top, |
384 const SkPaint* paint) | 384 const SkPaint* paint) |
385 : INHERITED(kDrawImage_OpType) | 385 : INHERITED(kDrawImage_OpType) |
386 , fImage(SkRef(image)) | 386 , fImage(SkRef(image)) |
387 , fLeft(left) | 387 , fLeft(left) |
388 , fTop(top) { | 388 , fTop(top) { |
389 | 389 |
| 390 fInfo.push(SkObjectParser::ImageToString(image)); |
| 391 fInfo.push(SkObjectParser::ScalarToString(left, "Left: ")); |
| 392 fInfo.push(SkObjectParser::ScalarToString(top, "Top: ")); |
| 393 |
390 if (paint) { | 394 if (paint) { |
391 fPaint.set(*paint); | 395 fPaint.set(*paint); |
| 396 fInfo.push(SkObjectParser::PaintToString(*paint)); |
392 } | 397 } |
393 } | 398 } |
394 | 399 |
395 void SkDrawImageCommand::execute(SkCanvas* canvas) const { | 400 void SkDrawImageCommand::execute(SkCanvas* canvas) const { |
396 canvas->drawImage(fImage, fLeft, fTop, fPaint.getMaybeNull()); | 401 canvas->drawImage(fImage, fLeft, fTop, fPaint.getMaybeNull()); |
397 } | 402 } |
398 | 403 |
399 bool SkDrawImageCommand::render(SkCanvas* canvas) const { | 404 bool SkDrawImageCommand::render(SkCanvas* canvas) const { |
400 SkAutoCanvasRestore acr(canvas, true); | 405 SkAutoCanvasRestore acr(canvas, true); |
401 canvas->clear(0xFFFFFFFF); | 406 canvas->clear(0xFFFFFFFF); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 | 982 |
978 void SkSetMatrixCommand::setUserMatrix(const SkMatrix& userMatrix) { | 983 void SkSetMatrixCommand::setUserMatrix(const SkMatrix& userMatrix) { |
979 fUserMatrix = userMatrix; | 984 fUserMatrix = userMatrix; |
980 } | 985 } |
981 | 986 |
982 void SkSetMatrixCommand::execute(SkCanvas* canvas) const { | 987 void SkSetMatrixCommand::execute(SkCanvas* canvas) const { |
983 SkMatrix temp = SkMatrix::Concat(fUserMatrix, fMatrix); | 988 SkMatrix temp = SkMatrix::Concat(fUserMatrix, fMatrix); |
984 canvas->setMatrix(temp); | 989 canvas->setMatrix(temp); |
985 } | 990 } |
986 | 991 |
OLD | NEW |