| Index: src/utils/debugger/SkDrawCommand.cpp
|
| diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
|
| index 9ebb81e74ae63d94c97a809b613173398c8c101c..330c2c9183cecf156a995c0b0b4d2feddeeb8190 100644
|
| --- a/src/utils/debugger/SkDrawCommand.cpp
|
| +++ b/src/utils/debugger/SkDrawCommand.cpp
|
| @@ -48,6 +48,7 @@
|
| case kDrawPosTextH_OpType: return "DrawPosTextH";
|
| case kDrawRect_OpType: return "DrawRect";
|
| case kDrawRRect_OpType: return "DrawRRect";
|
| + case kDrawSprite_OpType: return "DrawSprite";
|
| case kDrawText_OpType: return "DrawText";
|
| case kDrawTextBlob_OpType: return "DrawTextBlob";
|
| case kDrawTextOnPath_OpType: return "DrawTextOnPath";
|
| @@ -798,6 +799,36 @@
|
| return true;
|
| }
|
|
|
| +SkDrawSpriteCommand::SkDrawSpriteCommand(const SkBitmap& bitmap, int left, int top,
|
| + const SkPaint* paint)
|
| + : INHERITED(kDrawSprite_OpType) {
|
| + fBitmap = bitmap;
|
| + fLeft = left;
|
| + fTop = top;
|
| + if (paint) {
|
| + fPaint = *paint;
|
| + fPaintPtr = &fPaint;
|
| + } else {
|
| + fPaintPtr = nullptr;
|
| + }
|
| +
|
| + fInfo.push(SkObjectParser::BitmapToString(bitmap));
|
| + fInfo.push(SkObjectParser::IntToString(left, "Left: "));
|
| + fInfo.push(SkObjectParser::IntToString(top, "Top: "));
|
| + if (paint) {
|
| + fInfo.push(SkObjectParser::PaintToString(*paint));
|
| + }
|
| +}
|
| +
|
| +void SkDrawSpriteCommand::execute(SkCanvas* canvas) const {
|
| + canvas->drawSprite(fBitmap, fLeft, fTop, fPaintPtr);
|
| +}
|
| +
|
| +bool SkDrawSpriteCommand::render(SkCanvas* canvas) const {
|
| + render_bitmap(canvas, fBitmap);
|
| + return true;
|
| +}
|
| +
|
| SkDrawTextCommand::SkDrawTextCommand(const void* text, size_t byteLength, SkScalar x, SkScalar y,
|
| const SkPaint& paint)
|
| : INHERITED(kDrawText_OpType) {
|
|
|