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

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

Issue 462373002: Allow the native theme to paint the corner between scrollbars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the test a friend Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.h » ('j') | 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_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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 midy - grippy_half_width, 512 midy - grippy_half_width,
513 midy + grippy_half_width, 513 midy + grippy_half_width,
514 paint); 514 paint);
515 } 515 }
516 } 516 }
517 } 517 }
518 518
519 void NativeThemeBase::PaintScrollbarCorner(SkCanvas* canvas, 519 void NativeThemeBase::PaintScrollbarCorner(SkCanvas* canvas,
520 State state, 520 State state,
521 const gfx::Rect& rect) const { 521 const gfx::Rect& rect) const {
522 SkPaint paint;
523 paint.setColor(SK_ColorWHITE);
524 paint.setStyle(SkPaint::kFill_Style);
525 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
526 canvas->drawIRect(RectToSkIRect(rect), paint);
527 } 522 }
528 523
529 void NativeThemeBase::PaintCheckbox(SkCanvas* canvas, 524 void NativeThemeBase::PaintCheckbox(SkCanvas* canvas,
530 State state, 525 State state,
531 const gfx::Rect& rect, 526 const gfx::Rect& rect,
532 const ButtonExtraParams& button) const { 527 const ButtonExtraParams& button) const {
533 SkRect skrect = PaintCheckboxRadioCommon(canvas, state, rect, 528 SkRect skrect = PaintCheckboxRadioCommon(canvas, state, rect,
534 SkIntToScalar(2)); 529 SkIntToScalar(2));
535 if (!skrect.isEmpty()) { 530 if (!skrect.isEmpty()) {
536 // Draw the checkmark / dash. 531 // Draw the checkmark / dash.
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); 1080 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
1086 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); 1081 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
1087 1082
1088 if (hsv1[2] + hsv2[2] > 1.0) 1083 if (hsv1[2] + hsv2[2] > 1.0)
1089 diff = -diff; 1084 diff = -diff;
1090 1085
1091 return SaturateAndBrighten(hsv2, -0.2f, diff); 1086 return SaturateAndBrighten(hsv2, -0.2f, diff);
1092 } 1087 }
1093 1088
1094 } // namespace ui 1089 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698