Commit 09ecd921 authored by Thomas Lukaszewicz's avatar Thomas Lukaszewicz Committed by Commit Bot

Simplified the calculation of the background tab color in TabStrip

Removed the following color id definitions from GTK:
    COLOR_BACKGROUND_TAB,
    COLOR_BACKGROUND_TAB_INACTIVE,
    COLOR_BACKGROUND_TAB_INCOGNITO,
    COLOR_BACKGROUND_TAB_INCOGNITO_INACTIVE

The only place these color ids are referenced is in GTK ui from
TabStrip's GetBackgroundColor() method. In the GTK ui case the
tab background color resolved to the frame color, so alpha blending
the transparent color over the frame color was unnesessary. With the
current change the background tab color for GTK is simply the frame
color as intended.

In the remaining cases, the background color always resolves to an
opaque color and there is no need to alpha blend these over the frame
color, so the operation was removed.

Bug: 1056916
Change-Id: I3118dc8ebd34eaaff57029ba4a13c81d1f1f500c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090769
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747832}
parent 18265997
......@@ -917,13 +917,6 @@ void GtkUi::UpdateColors() {
colors_[ThemeProperties::COLOR_TAB_TEXT] = tab_text_color;
colors_[ThemeProperties::COLOR_BOOKMARK_TEXT] = tab_text_color;
colors_[ThemeProperties::COLOR_BACKGROUND_TAB] = SK_ColorTRANSPARENT;
colors_[ThemeProperties::COLOR_BACKGROUND_TAB_INACTIVE] = SK_ColorTRANSPARENT;
colors_[ThemeProperties::COLOR_BACKGROUND_TAB_INCOGNITO] =
SK_ColorTRANSPARENT;
colors_[ThemeProperties::COLOR_BACKGROUND_TAB_INCOGNITO_INACTIVE] =
SK_ColorTRANSPARENT;
colors_[ThemeProperties::COLOR_NTP_LINK] = native_theme_->GetSystemColor(
ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused);
......
......@@ -1926,7 +1926,7 @@ SkColor TabStrip::GetTabBackgroundColor(
: color_utils::HSLShift(
frame, tp->GetTint(ThemeProperties::TINT_BACKGROUND_TAB));
return color_utils::GetResultingPaintColor(background, frame);
return background;
}
SkColor TabStrip::GetTabForegroundColor(TabActive active,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment