summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornoms <noms@chromium.org>2015-01-22 17:08:51 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-23 01:09:33 +0000
commit298156be041512f6d4a78bdba5c90454d3d2dfdb (patch)
treee409c9f39f2954071a7ca6e7d93963ec1a6777dd
parentbc1bb9d28de48fe3dd339ed1948bbba9addc4bd9 (diff)
downloadchromium_src-298156be041512f6d4a78bdba5c90454d3d2dfdb.zip
chromium_src-298156be041512f6d4a78bdba5c90454d3d2dfdb.tar.gz
chromium_src-298156be041512f6d4a78bdba5c90454d3d2dfdb.tar.bz2
[Win] The tab strip's opaque background overlaps the avatar button.
The tab strip is actually about 4 px taller than the drawn tab, so when applying an alpha to make the inactive tabs slightly transparent, this alpha "leaks" onto the avatar button and adds a transparency to its bottom border. I set the background to red to demonstrate this, so here are some screenshots: Before the CL: https://drive.google.com/open?id=0B1B1Up4p2NRMRXRJRjN2MG41Y0k&authuser=1 After the CL: https://drive.google.com/open?id=0B1B1Up4p2NRMRzJJUmluT2QwSDA&authuser=1 Finally, how the tab strip actually looks like with normal colours: Before the CL: https://drive.google.com/open?id=0B1B1Up4p2NRMd0F0dWZnby12T0k&authuser=1 After the CL: https://drive.google.com/open?id=0B1B1Up4p2NRMa2o0aUNxaE12ZGs&authuser=1 BUG=430380 TEST=Start Chrome with --enable-new-avatar-menu. The bottom of the avatar button should look the same throughout (and not have any random transparencies) Review URL: https://codereview.chromium.org/859303008 Cr-Commit-Position: refs/heads/master@{#312721}
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 0fa4752..f35c59c 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1296,8 +1296,16 @@ void TabStrip::PaintChildren(gfx::Canvas* canvas,
paint.setColor(SkColorSetARGB(alpha, 255, 255, 255));
paint.setXfermodeMode(SkXfermode::kDstIn_Mode);
paint.setStyle(SkPaint::kFill_Style);
+
+ // The tab graphics include some shadows at the top, so the actual
+ // tabstrip top is 4 px. above the apparent top of the tab, to provide room
+ // to draw these. Exclude this region when trying to make tabs transparent
+ // as it's transparent enough already, and drawing in this region can
+ // overlap the avatar button, leading to visual artifacts.
+ const int kTopOffset = 4;
// The tabstrip area overlaps the toolbar area by 2 px.
- canvas->DrawRect(gfx::Rect(0, 0, width(), height() - 2), paint);
+ canvas->DrawRect(
+ gfx::Rect(0, kTopOffset, width(), height() - kTopOffset - 2), paint);
}
// Now selected but not active. We don't want these dimmed if using native