Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 1362693003: Improve debugger's visualization of transparent textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkDrawCommand.cpp
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index a9415dd924ef97bb54be03f20ab85b498931cd56..20aad3b9a510b6824d92b63a60d71034631e7d29 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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698