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

Unified Diff: ui/native_theme/native_theme_mac.mm

Issue 2680943002: ui: Clean up naming of paint-related identifiers (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_base.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_mac.mm
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm
index c8b39a34dc8dfbffcca03709e159ae50bbf42472..037ec203f125e373f4a5261f0f91edcd7aaa7f14 100644
--- a/ui/native_theme/native_theme_mac.mm
+++ b/ui/native_theme/native_theme_mac.mm
@@ -256,15 +256,15 @@ void NativeThemeMac::PaintMenuPopupBackground(
cc::PaintCanvas* canvas,
const gfx::Size& size,
const MenuBackgroundExtraParams& menu_background) const {
- cc::PaintFlags paint;
- paint.setAntiAlias(true);
+ cc::PaintFlags flags;
+ flags.setAntiAlias(true);
if (base::mac::IsOS10_9())
- paint.setColor(kMenuPopupBackgroundColorMavericks);
+ flags.setColor(kMenuPopupBackgroundColorMavericks);
else
- paint.setColor(kMenuPopupBackgroundColor);
+ flags.setColor(kMenuPopupBackgroundColor);
const SkScalar radius = SkIntToScalar(menu_background.corner_radius);
SkRect rect = gfx::RectToSkRect(gfx::Rect(size));
- canvas->drawRoundRect(rect, radius, radius, paint);
+ canvas->drawRoundRect(rect, radius, radius, flags);
}
void NativeThemeMac::PaintMenuItemBackground(
@@ -272,7 +272,7 @@ void NativeThemeMac::PaintMenuItemBackground(
State state,
const gfx::Rect& rect,
const MenuItemExtraParams& menu_item) const {
- cc::PaintFlags paint;
+ cc::PaintFlags flags;
switch (state) {
case NativeTheme::kNormal:
case NativeTheme::kDisabled:
@@ -283,8 +283,8 @@ void NativeThemeMac::PaintMenuItemBackground(
// pick colors. The System color "selectedMenuItemColor" is actually still
// blue for Graphite. And while "keyboardFocusIndicatorColor" does change,
// and is a good shade of gray, it's not blue enough for the Blue theme.
- paint.setColor(GetSystemColor(kColorId_FocusedMenuItemBackgroundColor));
- canvas->drawRect(gfx::RectToSkRect(rect), paint);
+ flags.setColor(GetSystemColor(kColorId_FocusedMenuItemBackgroundColor));
+ canvas->drawRect(gfx::RectToSkRect(rect), flags);
break;
default:
NOTREACHED();
@@ -409,32 +409,32 @@ void NativeThemeMac::PaintStyledGradientButton(cc::PaintCanvas* canvas,
else
shape.setRect(bounds);
- cc::PaintFlags paint;
- paint.setStyle(cc::PaintFlags::kFill_Style);
- paint.setAntiAlias(true);
+ cc::PaintFlags flags;
+ flags.setStyle(cc::PaintFlags::kFill_Style);
+ flags.setAntiAlias(true);
// First draw the darker "outer" border, with its gradient and shadow. Inside
// a tab strip, this will draw over the outer border and inner separator.
- paint.setLooper(gfx::CreateShadowDrawLooper(shadows));
- paint.setShader(
+ flags.setLooper(gfx::CreateShadowDrawLooper(shadows));
+ flags.setShader(
cc::WrapSkShader(GetButtonBorderShader(type, shape.height())));
- canvas->drawRRect(shape, paint);
+ canvas->drawRRect(shape, flags);
// Then, inset the rounded rect and draw over that with the inner gradient.
shape.inset(kBorderThickness, kBorderThickness);
- paint.setLooper(nullptr);
- paint.setShader(
+ flags.setLooper(nullptr);
+ flags.setShader(
cc::WrapSkShader(GetButtonBackgroundShader(type, shape.height())));
- canvas->drawRRect(shape, paint);
+ canvas->drawRRect(shape, flags);
if (!focus)
return;
SkRRect outer_shape;
shape.outset(kFocusRingThickness, kFocusRingThickness, &outer_shape);
- paint.setShader(nullptr);
- paint.setColor(kFocusRingColor);
- canvas->drawDRRect(outer_shape, shape, paint);
+ flags.setShader(nullptr);
+ flags.setColor(kFocusRingColor);
+ canvas->drawDRRect(outer_shape, shape, flags);
}
NativeThemeMac::NativeThemeMac() {
« no previous file with comments | « ui/native_theme/native_theme_base.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698