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_base.h" | 5 #include "ui/base/native_theme/native_theme_base.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "grit/gfx_resources.h" | 10 #include "grit/native_theme_resources.h" |
11 #include "third_party/skia/include/effects/SkGradientShader.h" | 11 #include "third_party/skia/include/effects/SkGradientShader.h" |
12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
13 #include "ui/gfx/color_utils.h" | 13 #include "ui/gfx/color_utils.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // These are the default dimensions of radio buttons and checkboxes. | 19 // These are the default dimensions of radio buttons and checkboxes. |
20 const int kCheckboxAndRadioWidth = 13; | 20 const int kCheckboxAndRadioWidth = 13; |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); | 964 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); |
965 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); | 965 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); |
966 | 966 |
967 if (hsv1[2] + hsv2[2] > 1.0) | 967 if (hsv1[2] + hsv2[2] > 1.0) |
968 diff = -diff; | 968 diff = -diff; |
969 | 969 |
970 return SaturateAndBrighten(hsv2, -0.2f, diff); | 970 return SaturateAndBrighten(hsv2, -0.2f, diff); |
971 } | 971 } |
972 | 972 |
973 } // namespace ui | 973 } // namespace ui |
OLD | NEW |