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

Issue 2770603002: Add --draw-view-bounds-rects to draw bounds rects for all views. (Closed)

Created:
3 years, 9 months ago by Peter Kasting
Modified:
3 years, 9 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add --draw-view-bounds-rects to draw bounds rects for all views. This is useful for debugging and measuring layouts. Some details: * Simple on/off command-line switch. Filtering to a subset of views seems theoretically useful. I thought of comparing the accessible name of each view against a wildcarded command-line argument, but this seemed more trouble than it was worth, when people were unlikely to know accessible names anyway. * I tried filled (rather than stroked) rects, which was better for visualizing overdraw, but worse for easily measuring distances and such. I suppose we could have flags to do both if people really cared. * Uses ARGB 0x30ff0000 rects, so the intensity of the red indicates the number of views sharing that border. * Borders are drawn with 1 px (not DIP) rects inset from the bounds, so a view adjacent to another view should not appear to share a border line; you should get two adjacent lines. * For non-integral DSFs, snaps to integral pixel widths by flooring the view's scaled size. * Implemented as a separate painting pass so children/siblings don't draw atop the rects, but this only goes so far; separate layers can still potentially obscure these rects. I don't know how to solve this. BUG=none TEST=none Review-Url: https://codereview.chromium.org/2770603002 Cr-Commit-Position: refs/heads/master@{#458925} Committed: https://chromium.googlesource.com/chromium/src/+/be50046d5ab84d12920bfab89131506f002aab11

Patch Set 1 #

Total comments: 6

Patch Set 2 : Review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -32 lines) Patch
M ui/views/view.h View 1 2 chunks +30 lines, -0 lines 0 comments Download
M ui/views/view.cc View 1 8 chunks +73 lines, -31 lines 0 comments Download
M ui/views/views_switches.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/views_switches.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 14 (7 generated)
Peter Kasting
3 years, 9 months ago (2017-03-22 05:27:28 UTC) #2
sky
Nice! LGTM - I would like a better name for PaintRoot() (see comments below), but ...
3 years, 9 months ago (2017-03-22 15:26:05 UTC) #3
Peter Kasting
https://codereview.chromium.org/2770603002/diff/1/ui/views/view.h File ui/views/view.h (right): https://codereview.chromium.org/2770603002/diff/1/ui/views/view.h#newcode1400 ui/views/view.h:1400: // Painting ------------------------------------------------------------------ On 2017/03/22 15:26:05, sky wrote: > ...
3 years, 9 months ago (2017-03-22 21:39:11 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2770603002/20001
3 years, 9 months ago (2017-03-22 21:40:09 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/345908)
3 years, 9 months ago (2017-03-22 22:37:30 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2770603002/20001
3 years, 9 months ago (2017-03-22 22:46:55 UTC) #11
commit-bot: I haz the power
3 years, 9 months ago (2017-03-22 23:21:59 UTC) #14
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/be50046d5ab84d12920bfab89131...

Powered by Google App Engine
This is Rietveld 408576698