DescriptionProper rendering of stacked tabs for MD.
When stacking tabs in MD, we now draw the fill and stroke separately, drawing the fill completely but clipping the stroke against the neighboring tab's stroke. Drawing the fill without this clipping allows the fill to underlay the overlapped tab's stroke, while clipping the stroke prevents unsightly overdraw. To prevent this from being excessively inefficient, we only use this two-image technique when we might actually be clipping one tab against another (see subsequent paragraphs).
This also changes tab and close button hit-testing to use more precise masks in the case of stacked tabs. Previously, when not stacking, we'd use hit-test regions the same shape as the tab, but when stacking, we'd switch to less-accurate rectangular regions. We now use precise masks in both cases, with the difference being that when not stacking, the hit region for a tab "behind" another tab is still shaped like the full tab, while when stacking, that hit region is actually clipped by the tab that's "on top". It's not clear to me how this affects touch hit-testing. It seems like we don't really need/want the stacked and not-stacked cases to differ here. I kind of think we want to clip in both cases, which would unify the behavior and perhaps simplify the code, but I'm not sure. There is a comment in about this.
Tab close buttons work similarly: we now intersect the close button's square mask with its parent tab's mask, so when stacking, the close buttons are clipped by overlaid tabs. Per a TODO in the code, I removed the existing code that made the tab close button entirely un-hittable in this case. Once again, I left a comment asking precisely what the effect of these shape changes on touch targeting is. Note that it's not convenient to clip the close button masks like this without also clipping the tab masks themselves as in the above paragraph; one depends on the other.
BUG=609022
TEST=Trigger stacked tabs mode, stack some tabs, and ensure the top strokes don't visible overlap (and make a darker stroke)
Committed: https://crrev.com/59ea4a04aa8b4db5e7413761864902570601e309
Cr-Commit-Position: refs/heads/master@{#411197}
Patch Set 1 #Patch Set 2 : Fix compile #
Total comments: 1
Patch Set 3 : Try ripping out masking #Patch Set 4 : Resync #Patch Set 5 : Resync #
Messages
Total messages: 28 (14 generated)
|