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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 2893083002: cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: update Created 3 years, 6 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/gfx/skia_paint_util.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_base.cc
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index d36a2c31faf9dad97f0cc8034b7e9559ec1b82fd..6711ce93a3f085943bd1304364b0708f056f72b2 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -600,11 +600,11 @@ SkRect NativeThemeBase::PaintCheckboxRadioCommon(
SkColor colors[3] = {startEndColors[0], startEndColors[0], startEndColors[1]};
cc::PaintFlags flags;
flags.setAntiAlias(true);
- flags.setShader(cc::WrapSkShader(SkGradientShader::MakeLinear(
- gradient_bounds, colors, NULL, 3, SkShader::kClamp_TileMode)));
+ flags.setShader(cc::PaintShader::MakeLinearGradient(
+ gradient_bounds, colors, nullptr, 3, SkShader::kClamp_TileMode));
flags.setStyle(cc::PaintFlags::kFill_Style);
canvas->drawRoundRect(skrect, borderRadius, borderRadius, flags);
- flags.setShader(NULL);
+ flags.setShader(nullptr);
// Draw the border.
if (state == kHovered)
@@ -681,11 +681,11 @@ void NativeThemeBase::PaintButton(cc::PaintCanvas* canvas,
flags.setStyle(cc::PaintFlags::kFill_Style);
flags.setAntiAlias(true);
- flags.setShader(cc::WrapSkShader(SkGradientShader::MakeLinear(
- gradient_bounds, colors, NULL, 2, SkShader::kClamp_TileMode)));
+ flags.setShader(cc::PaintShader::MakeLinearGradient(
+ gradient_bounds, colors, nullptr, 2, SkShader::kClamp_TileMode));
canvas->drawRoundRect(skrect, SkIntToScalar(1), SkIntToScalar(1), flags);
- flags.setShader(NULL);
+ flags.setShader(nullptr);
if (button.has_border) {
int border_alpha = state == kHovered ? 0x80 : 0x55;
« no previous file with comments | « ui/gfx/skia_paint_util.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698