OLD | NEW |
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/base/native_theme/native_theme_android.h" | 5 #include "ui/base/native_theme/native_theme_android.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "grit/gfx_resources.h" | 11 #include "grit/native_theme_resources.h" |
12 #include "third_party/skia/include/effects/SkGradientShader.h" | 12 #include "third_party/skia/include/effects/SkGradientShader.h" |
13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
14 #include "ui/gfx/color_utils.h" | 14 #include "ui/gfx/color_utils.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 | 19 |
20 const unsigned int kButtonLength = 14; | 20 const unsigned int kButtonLength = 14; |
21 const unsigned int kScrollbarWidth = 15; | 21 const unsigned int kScrollbarWidth = 15; |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2, 0.28, 0.5); | 793 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2, 0.28, 0.5); |
794 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5); | 794 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5); |
795 | 795 |
796 if (hsv1[2] + hsv2[2] > 1.0) | 796 if (hsv1[2] + hsv2[2] > 1.0) |
797 diff = -diff; | 797 diff = -diff; |
798 | 798 |
799 return SaturateAndBrighten(hsv2, -0.2, diff); | 799 return SaturateAndBrighten(hsv2, -0.2, diff); |
800 } | 800 } |
801 | 801 |
802 } // namespace ui | 802 } // namespace ui |
OLD | NEW |