diff options
author | fmalita <fmalita@chromium.org> | 2014-08-29 15:08:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-29 15:08:20 -0700 |
commit | 5577387f25e8321799de71e163f05bd8ef53a40f (patch) | |
tree | 66a94b51f57e0b6616f92023996cc531d7982956 /src/utils | |
parent | 6267f81f3d60ce144ab2b09ea369420984d5c9d9 (diff) |
Debugger render support for SkDrawTextBlobCommand.
R=robertphillips@google.com
Author: fmalita@chromium.org
Review URL: https://codereview.chromium.org/523833003
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 14 | ||||
-rw-r--r-- | src/utils/debugger/SkDrawCommand.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index 3a073962cc..b9742c3535 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -666,6 +666,20 @@ void SkDrawTextBlobCommand::execute(SkCanvas* canvas) { canvas->drawTextBlob(fBlob, fXPos, fYPos, fPaint); } +bool SkDrawTextBlobCommand::render(SkCanvas* canvas) const { + canvas->clear(SK_ColorWHITE); + canvas->save(); + + SkRect bounds = fBlob->bounds().makeOffset(fXPos, fYPos); + xlate_and_scale_to_bounds(canvas, bounds); + + canvas->drawTextBlob(fBlob.get(), fXPos, fYPos, fPaint); + + canvas->restore(); + + return true; +} + SkDrawRectCommand::SkDrawRectCommand(const SkRect& rect, const SkPaint& paint) : INHERITED(DRAW_RECT) { fRect = rect; diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h index f3c8cca9de..def0db4d8a 100644 --- a/src/utils/debugger/SkDrawCommand.h +++ b/src/utils/debugger/SkDrawCommand.h @@ -441,6 +441,7 @@ public: SkDrawTextBlobCommand(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint); virtual void execute(SkCanvas* canvas) SK_OVERRIDE; + virtual bool render(SkCanvas* canvas) const SK_OVERRIDE; private: SkAutoTUnref<const SkTextBlob> fBlob; |