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

Issue 2210033002: Proper rendering of stacked tabs for MD. (Closed)

Created:
4 years, 4 months ago by Peter Kasting
Modified:
4 years, 4 months ago
Reviewers:
tdanderson, sky
CC:
chromium-reviews, tfarina, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Proper 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -176 lines) Patch
M chrome/browser/ui/views/tabs/tab.h View 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab.cc View 1 2 3 4 14 chunks +118 lines, -151 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_controller.h View 4 chunks +15 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_strip.h View 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/tab_strip.cc View 5 chunks +14 lines, -15 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_unittest.cc View 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 28 (14 generated)
Peter Kasting
This basically works, but I have some questions about the inconsistency of how we're generating ...
4 years, 4 months ago (2016-08-04 00:41:31 UTC) #3
sky
I wanted to try this out and ponder it, but I get compile errors: d:\src\builds\build2\src\chrome\browser\ui\views\tabs\tab.cc(1488): ...
4 years, 4 months ago (2016-08-04 16:48:00 UTC) #8
Peter Kasting
On 2016/08/04 16:48:00, sky wrote: > I wanted to try this out and ponder it, ...
4 years, 4 months ago (2016-08-04 21:24:02 UTC) #10
sky
LGTM and I didn't notice any oddities. Seems to me we should clip in both ...
4 years, 4 months ago (2016-08-04 23:42:09 UTC) #11
Peter Kasting
Terry, do you happen to know whether touch targeting will be affected (presumably, made more ...
4 years, 4 months ago (2016-08-05 00:52:00 UTC) #13
Peter Kasting
Terry: try the current patch set, which rips out the masking entirely.
4 years, 4 months ago (2016-08-08 22:50:49 UTC) #14
tdanderson
On 2016/08/08 22:50:49, Peter Kasting wrote: > Terry: try the current patch set, which rips ...
4 years, 4 months ago (2016-08-09 22:57:09 UTC) #15
Peter Kasting
Try it now.
4 years, 4 months ago (2016-08-10 00:16:36 UTC) #16
tdanderson
On 2016/08/10 00:16:36, Peter Kasting wrote: > Try it now. Touch hit-testing of stacked tabs ...
4 years, 4 months ago (2016-08-10 12:44:16 UTC) #17
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/2210033002/80001
4 years, 4 months ago (2016-08-10 21:15:06 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/259612)
4 years, 4 months ago (2016-08-10 22:48:35 UTC) #22
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/2210033002/80001
4 years, 4 months ago (2016-08-10 23:33:36 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-08-11 00:14:38 UTC) #26
commit-bot: I haz the power
4 years, 4 months ago (2016-08-11 00:16:53 UTC) #28
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/59ea4a04aa8b4db5e7413761864902570601e309
Cr-Commit-Position: refs/heads/master@{#411197}

Powered by Google App Engine
This is Rietveld 408576698