DescriptionAdd --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 #
Messages
Total messages: 14 (7 generated)
|