| 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/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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 break; | 209 break; |
| 210 case kScrollbarHorizontalTrack: | 210 case kScrollbarHorizontalTrack: |
| 211 case kScrollbarVerticalTrack: | 211 case kScrollbarVerticalTrack: |
| 212 PaintScrollbarTrack(canvas, part, state, extra.scrollbar_track, rect); | 212 PaintScrollbarTrack(canvas, part, state, extra.scrollbar_track, rect); |
| 213 break; | 213 break; |
| 214 case kScrollbarHorizontalGripper: | 214 case kScrollbarHorizontalGripper: |
| 215 case kScrollbarVerticalGripper: | 215 case kScrollbarVerticalGripper: |
| 216 // Invoked by views scrollbar code, don't care about for non-win | 216 // Invoked by views scrollbar code, don't care about for non-win |
| 217 // implementations, so no NOTIMPLEMENTED. | 217 // implementations, so no NOTIMPLEMENTED. |
| 218 break; | 218 break; |
| 219 case kScrollbarCorner: |
| 220 PaintScrollbarCorner(canvas, state, rect); |
| 221 break; |
| 219 case kSliderTrack: | 222 case kSliderTrack: |
| 220 PaintSliderTrack(canvas, state, rect, extra.slider); | 223 PaintSliderTrack(canvas, state, rect, extra.slider); |
| 221 break; | 224 break; |
| 222 case kSliderThumb: | 225 case kSliderThumb: |
| 223 PaintSliderThumb(canvas, state, rect, extra.slider); | 226 PaintSliderThumb(canvas, state, rect, extra.slider); |
| 224 break; | 227 break; |
| 225 case kTabPanelBackground: | 228 case kTabPanelBackground: |
| 226 NOTIMPLEMENTED(); | 229 NOTIMPLEMENTED(); |
| 227 break; | 230 break; |
| 228 case kTextField: | 231 case kTextField: |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 paint); | 484 paint); |
| 482 DrawVertLine(canvas, | 485 DrawVertLine(canvas, |
| 483 midx + inter_grippy_offset, | 486 midx + inter_grippy_offset, |
| 484 midy - grippy_half_width, | 487 midy - grippy_half_width, |
| 485 midy + grippy_half_width, | 488 midy + grippy_half_width, |
| 486 paint); | 489 paint); |
| 487 } | 490 } |
| 488 } | 491 } |
| 489 } | 492 } |
| 490 | 493 |
| 494 void NativeThemeBase::PaintScrollbarCorner(SkCanvas* canvas, |
| 495 State state, |
| 496 const gfx::Rect& rect) const { |
| 497 canvas->drawColor(SK_ColorWHITE, SkXfermode::kSrc_Mode); |
| 498 } |
| 499 |
| 491 void NativeThemeBase::PaintCheckbox(SkCanvas* canvas, | 500 void NativeThemeBase::PaintCheckbox(SkCanvas* canvas, |
| 492 State state, | 501 State state, |
| 493 const gfx::Rect& rect, | 502 const gfx::Rect& rect, |
| 494 const ButtonExtraParams& button) const { | 503 const ButtonExtraParams& button) const { |
| 495 SkRect skrect = PaintCheckboxRadioCommon(canvas, state, rect, | 504 SkRect skrect = PaintCheckboxRadioCommon(canvas, state, rect, |
| 496 SkIntToScalar(2)); | 505 SkIntToScalar(2)); |
| 497 if (!skrect.isEmpty()) { | 506 if (!skrect.isEmpty()) { |
| 498 // Draw the checkmark / dash. | 507 // Draw the checkmark / dash. |
| 499 SkPaint paint; | 508 SkPaint paint; |
| 500 paint.setAntiAlias(true); | 509 paint.setAntiAlias(true); |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); | 1126 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); |
| 1118 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); | 1127 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); |
| 1119 | 1128 |
| 1120 if (hsv1[2] + hsv2[2] > 1.0) | 1129 if (hsv1[2] + hsv2[2] > 1.0) |
| 1121 diff = -diff; | 1130 diff = -diff; |
| 1122 | 1131 |
| 1123 return SaturateAndBrighten(hsv2, -0.2f, diff); | 1132 return SaturateAndBrighten(hsv2, -0.2f, diff); |
| 1124 } | 1133 } |
| 1125 | 1134 |
| 1126 } // namespace ui | 1135 } // namespace ui |
| OLD | NEW |