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

Side by Side Diff: ui/native_theme/native_theme_aura.cc

Issue 2815833005: Update alpha values when painting overlay scrollbars. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/native_theme/native_theme_aura.h" 5 #include "ui/native_theme/native_theme_aura.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return; 193 return;
194 194
195 TRACE_EVENT0("blink", "NativeThemeAura::PaintScrollbarThumb"); 195 TRACE_EVENT0("blink", "NativeThemeAura::PaintScrollbarThumb");
196 196
197 SkAlpha thumb_alpha = SK_AlphaTRANSPARENT; 197 SkAlpha thumb_alpha = SK_AlphaTRANSPARENT;
198 gfx::Rect thumb_rect(rect); 198 gfx::Rect thumb_rect(rect);
199 SkColor thumb_color; 199 SkColor thumb_color;
200 200
201 if (use_overlay_scrollbars_) { 201 if (use_overlay_scrollbars_) {
202 // Constants used for painting overlay scrollbar thumb. 202 // Constants used for painting overlay scrollbar thumb.
203 constexpr SkAlpha kOverlayScrollbarFillAlphaNormal = 0x4D; 203 constexpr SkAlpha kOverlayScrollbarFillAlphaNormal = 0x80;
204 constexpr SkAlpha kOverlayScrollbarFillAlphaHovered = 0x80; 204 constexpr SkAlpha kOverlayScrollbarFillAlphaHovered = 0xB3;
205 constexpr SkAlpha kOverlayScrollbarFillAlphaPressed = 0x80; 205 constexpr SkAlpha kOverlayScrollbarFillAlphaPressed = 0xB3;
206 constexpr SkAlpha kOverlayScrollbarStrokeAlphaNormal = 0x4D; 206 constexpr SkAlpha kOverlayScrollbarStrokeAlphaNormal = 0x4D;
207 constexpr SkAlpha kOverlayScrollbarStrokeAlphaHovered = 0x58; 207 constexpr SkAlpha kOverlayScrollbarStrokeAlphaHovered = 0x80;
208 constexpr SkAlpha kOverlayScrollbarStrokeAlphaPressed = 0x80; 208 constexpr SkAlpha kOverlayScrollbarStrokeAlphaPressed = 0x80;
209 209
210 // Indexed by ScrollbarOverlayColorTheme. 210 // Indexed by ScrollbarOverlayColorTheme.
211 constexpr SkColor kOverlayScrollbarThumbColor[] = {SK_ColorBLACK, 211 constexpr SkColor kOverlayScrollbarThumbColor[] = {SK_ColorBLACK,
212 SK_ColorWHITE}; 212 SK_ColorWHITE};
213 constexpr SkColor kOverlayScrollbarStrokeColor[] = {SK_ColorWHITE, 213 constexpr SkColor kOverlayScrollbarStrokeColor[] = {SK_ColorWHITE,
214 SK_ColorBLACK}; 214 SK_ColorBLACK};
215 215
216 thumb_color = kOverlayScrollbarThumbColor[theme]; 216 thumb_color = kOverlayScrollbarThumbColor[theme];
217 217
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 350
351 gfx::Rect NativeThemeAura::GetNinePatchAperture(Part part) const { 351 gfx::Rect NativeThemeAura::GetNinePatchAperture(Part part) const {
352 DCHECK(SupportsNinePatch(part)); 352 DCHECK(SupportsNinePatch(part));
353 353
354 return gfx::Rect( 354 return gfx::Rect(
355 kOverlayScrollbarBorderPatchWidth, kOverlayScrollbarBorderPatchWidth, 355 kOverlayScrollbarBorderPatchWidth, kOverlayScrollbarBorderPatchWidth,
356 kOverlayScrollbarCenterPatchSize, kOverlayScrollbarCenterPatchSize); 356 kOverlayScrollbarCenterPatchSize, kOverlayScrollbarCenterPatchSize);
357 } 357 }
358 358
359 } // namespace ui 359 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698