diff options
author | robertphillips <robertphillips@google.com> | 2015-09-24 06:56:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-24 06:56:27 -0700 |
commit | 96a5cfffff574cc899618b0ea64bf5188c31a92a (patch) | |
tree | 400ba91a904b5a7e36684f4f2ae629a32ff62a8a | |
parent | 6fccec34d2f83d04aa5c1a7a663d7760769972d8 (diff) |
Improve debugger's visualization of transparent textures
Review URL: https://codereview.chromium.org/1362693003
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index a9415dd924..20aad3b9a5 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -130,7 +130,25 @@ void render_bitmap(SkCanvas* canvas, const SkBitmap& input, const SkRect* srcRec xScale * input.width(), yScale * input.height()); + static const int kNumBlocks = 8; + canvas->clear(0xFFFFFFFF); + SkISize block = { + canvas->imageInfo().width()/kNumBlocks, + canvas->imageInfo().height()/kNumBlocks + }; + for (int y = 0; y < kNumBlocks; ++y) { + for (int x = 0; x < kNumBlocks; ++x) { + SkPaint paint; + paint.setColor((x+y)%2 ? SK_ColorLTGRAY : SK_ColorDKGRAY); + SkRect r = SkRect::MakeXYWH(SkIntToScalar(x*block.width()), + SkIntToScalar(y*block.height()), + SkIntToScalar(block.width()), + SkIntToScalar(block.height())); + canvas->drawRect(r, paint); + } + } + canvas->drawBitmapRect(input, dst, nullptr); if (srcRect) { |