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

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

Issue 1574913004: Render aura scrollbars programmatically instead of with ninebox assets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove assets Created 4 years, 11 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
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_base.h" 5 #include "ui/native_theme/native_theme_base.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 double progress, 166 double progress,
167 const gfx::Rect& rect) const { 167 const gfx::Rect& rect) const {
168 if (rect.IsEmpty()) 168 if (rect.IsEmpty())
169 return; 169 return;
170 170
171 // Currently state transition is animation only working for overlay scrollbars 171 // Currently state transition is animation only working for overlay scrollbars
172 // on Aura platforms. 172 // on Aura platforms.
173 switch (part) { 173 switch (part) {
174 case kScrollbarHorizontalThumb: 174 case kScrollbarHorizontalThumb:
175 case kScrollbarVerticalThumb: 175 case kScrollbarVerticalThumb:
176 PaintScrollbarThumbStateTransition( 176 PaintScrollbarThumbStateTransition(canvas, part, startState, endState,
177 canvas, startState, endState, progress, rect); 177 progress, rect);
178 break; 178 break;
179 default: 179 default:
180 NOTREACHED() << "Does not support state transition for this part:" 180 NOTREACHED() << "Does not support state transition for this part:"
181 << part; 181 << part;
182 break; 182 break;
183 } 183 }
184 return; 184 return;
185 } 185 }
186 186
187 void NativeThemeBase::Paint(SkCanvas* canvas, 187 void NativeThemeBase::Paint(SkCanvas* canvas,
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); 1035 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
1036 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); 1036 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
1037 1037
1038 if (hsv1[2] + hsv2[2] > 1.0) 1038 if (hsv1[2] + hsv2[2] > 1.0)
1039 diff = -diff; 1039 diff = -diff;
1040 1040
1041 return SaturateAndBrighten(hsv2, -0.2f, diff); 1041 return SaturateAndBrighten(hsv2, -0.2f, diff);
1042 } 1042 }
1043 1043
1044 } // namespace ui 1044 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698