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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 // FIXME: push blob info | 659 // FIXME: push blob info |
660 fInfo.push(SkObjectParser::ScalarToString(x, "XPOS: ")); | 660 fInfo.push(SkObjectParser::ScalarToString(x, "XPOS: ")); |
661 fInfo.push(SkObjectParser::ScalarToString(x, "YPOS: ")); | 661 fInfo.push(SkObjectParser::ScalarToString(x, "YPOS: ")); |
662 fInfo.push(SkObjectParser::PaintToString(paint)); | 662 fInfo.push(SkObjectParser::PaintToString(paint)); |
663 } | 663 } |
664 | 664 |
665 void SkDrawTextBlobCommand::execute(SkCanvas* canvas) { | 665 void SkDrawTextBlobCommand::execute(SkCanvas* canvas) { |
666 canvas->drawTextBlob(fBlob, fXPos, fYPos, fPaint); | 666 canvas->drawTextBlob(fBlob, fXPos, fYPos, fPaint); |
667 } | 667 } |
668 | 668 |
| 669 bool SkDrawTextBlobCommand::render(SkCanvas* canvas) const { |
| 670 canvas->clear(SK_ColorWHITE); |
| 671 canvas->save(); |
| 672 |
| 673 SkRect bounds = fBlob->bounds().makeOffset(fXPos, fYPos); |
| 674 xlate_and_scale_to_bounds(canvas, bounds); |
| 675 |
| 676 canvas->drawTextBlob(fBlob.get(), fXPos, fYPos, fPaint); |
| 677 |
| 678 canvas->restore(); |
| 679 |
| 680 return true; |
| 681 } |
| 682 |
669 SkDrawRectCommand::SkDrawRectCommand(const SkRect& rect, const SkPaint& paint) | 683 SkDrawRectCommand::SkDrawRectCommand(const SkRect& rect, const SkPaint& paint) |
670 : INHERITED(DRAW_RECT) { | 684 : INHERITED(DRAW_RECT) { |
671 fRect = rect; | 685 fRect = rect; |
672 fPaint = paint; | 686 fPaint = paint; |
673 | 687 |
674 fInfo.push(SkObjectParser::RectToString(rect)); | 688 fInfo.push(SkObjectParser::RectToString(rect)); |
675 fInfo.push(SkObjectParser::PaintToString(paint)); | 689 fInfo.push(SkObjectParser::PaintToString(paint)); |
676 } | 690 } |
677 | 691 |
678 void SkDrawRectCommand::execute(SkCanvas* canvas) { | 692 void SkDrawRectCommand::execute(SkCanvas* canvas) { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 p.setColor(SK_ColorCYAN); | 1016 p.setColor(SK_ColorCYAN); |
1003 p.setStyle(SkPaint::kStroke_Style); | 1017 p.setStyle(SkPaint::kStroke_Style); |
1004 canvas->drawRect(fCullRect, p); | 1018 canvas->drawRect(fCullRect, p); |
1005 } | 1019 } |
1006 | 1020 |
1007 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } | 1021 SkPopCullCommand::SkPopCullCommand() : INHERITED(POP_CULL) { } |
1008 | 1022 |
1009 void SkPopCullCommand::execute(SkCanvas* canvas) { | 1023 void SkPopCullCommand::execute(SkCanvas* canvas) { |
1010 canvas->popCull(); | 1024 canvas->popCull(); |
1011 } | 1025 } |
OLD | NEW |