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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 491 } |
492 | 492 |
493 void SkDrawPictureCommand::execute(SkCanvas* canvas) { | 493 void SkDrawPictureCommand::execute(SkCanvas* canvas) { |
494 canvas->drawPicture(fPicture); | 494 canvas->drawPicture(fPicture); |
495 } | 495 } |
496 | 496 |
497 bool SkDrawPictureCommand::render(SkCanvas* canvas) const { | 497 bool SkDrawPictureCommand::render(SkCanvas* canvas) const { |
498 canvas->clear(0xFFFFFFFF); | 498 canvas->clear(0xFFFFFFFF); |
499 canvas->save(); | 499 canvas->save(); |
500 | 500 |
501 SkRect bounds = SkRect::MakeWH(fPicture.width(), fPicture.height()); | 501 SkRect bounds = SkRect::MakeWH(SkIntToScalar(fPicture.width()), |
| 502 SkIntToScalar(fPicture.height())); |
502 xlate_and_scale_to_bounds(canvas, bounds); | 503 xlate_and_scale_to_bounds(canvas, bounds); |
503 | 504 |
504 canvas->drawPicture(const_cast<SkPicture&>(fPicture)); | 505 canvas->drawPicture(const_cast<SkPicture&>(fPicture)); |
505 | 506 |
506 canvas->restore(); | 507 canvas->restore(); |
507 | 508 |
508 return true; | 509 return true; |
509 } | 510 } |
510 | 511 |
511 SkDrawPointsCommand::SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count, | 512 SkDrawPointsCommand::SkDrawPointsCommand(SkCanvas::PointMode mode, size_t count, |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 fDy = dy; | 890 fDy = dy; |
890 fDrawType = TRANSLATE; | 891 fDrawType = TRANSLATE; |
891 | 892 |
892 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); | 893 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); |
893 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); | 894 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); |
894 } | 895 } |
895 | 896 |
896 void SkTranslateCommand::execute(SkCanvas* canvas) { | 897 void SkTranslateCommand::execute(SkCanvas* canvas) { |
897 canvas->translate(fDx, fDy); | 898 canvas->translate(fDx, fDy); |
898 } | 899 } |
OLD | NEW |