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

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 10 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
« no previous file with comments | « ui/views/controls/button/toggle_button.cc ('k') | ui/views/controls/focus_ring.cc » ('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/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 SkPath path; 850 SkPath path;
851 // This epsilon makes sure that all the aliasing pixels are slightly more 851 // This epsilon makes sure that all the aliasing pixels are slightly more
852 // than half full. Otherwise, rounding issues cause some to be considered 852 // than half full. Otherwise, rounding issues cause some to be considered
853 // slightly less than half full and come out a little lighter. 853 // slightly less than half full and come out a little lighter.
854 const SkScalar kEpsilon = 0.0001f; 854 const SkScalar kEpsilon = 0.0001f;
855 path.moveTo(x - kEpsilon, y); 855 path.moveTo(x - kEpsilon, y);
856 path.rLineTo(height, height); 856 path.rLineTo(height, height);
857 path.rLineTo(2 * kEpsilon, 0); 857 path.rLineTo(2 * kEpsilon, 0);
858 path.rLineTo(height, -height); 858 path.rLineTo(height, -height);
859 path.close(); 859 path.close();
860 SkPaint paint; 860 cc::PaintFlags paint;
861 SkColor arrow_color = GetNativeTheme()->GetSystemColor( 861 SkColor arrow_color = GetNativeTheme()->GetSystemColor(
862 ui::NativeTheme::kColorId_ButtonEnabledColor); 862 ui::NativeTheme::kColorId_ButtonEnabledColor);
863 if (!enabled()) 863 if (!enabled())
864 arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha); 864 arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha);
865 paint.setColor(arrow_color); 865 paint.setColor(arrow_color);
866 paint.setAntiAlias(true); 866 paint.setAntiAlias(true);
867 canvas->DrawPath(path, paint); 867 canvas->DrawPath(path, paint);
868 } else { 868 } else {
869 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y()); 869 canvas->DrawImageInt(arrow_image_, arrow_bounds.x(), arrow_bounds.y());
870 } 870 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 const int kMdPaddingWidth = 8; 1009 const int kMdPaddingWidth = 8;
1010 int arrow_pad = UseMd() ? kMdPaddingWidth 1010 int arrow_pad = UseMd() ? kMdPaddingWidth
1011 : PlatformStyle::kComboboxNormalArrowPadding; 1011 : PlatformStyle::kComboboxNormalArrowPadding;
1012 int padding = style_ == STYLE_NORMAL 1012 int padding = style_ == STYLE_NORMAL
1013 ? arrow_pad * 2 1013 ? arrow_pad * 2
1014 : kActionLeftPadding + kActionRightPadding; 1014 : kActionLeftPadding + kActionRightPadding;
1015 return ArrowSize().width() + padding; 1015 return ArrowSize().width() + padding;
1016 } 1016 }
1017 1017
1018 } // namespace views 1018 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/toggle_button.cc ('k') | ui/views/controls/focus_ring.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698