summaryrefslogtreecommitdiffstats
path: root/ui/native_theme/native_theme_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/native_theme/native_theme_base.cc')
-rw-r--r--ui/native_theme/native_theme_base.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index fa6151f..91a5172 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -576,12 +576,12 @@ SkRect NativeThemeBase::PaintCheckboxRadioNewCommon(
else /* kNormal */
startEndColors = kCheckboxGradientColors;
SkColor colors[3] = {startEndColors[0], startEndColors[0], startEndColors[1]};
- SkShader* shader = SkGradientShader::CreateLinear(
- gradient_bounds, colors, NULL, 3, SkShader::kClamp_TileMode, NULL);
+ skia::RefPtr<SkShader> shader = skia::AdoptRef(
+ SkGradientShader::CreateLinear(
+ gradient_bounds, colors, NULL, 3, SkShader::kClamp_TileMode, NULL));
SkPaint paint;
paint.setAntiAlias(true);
- paint.setShader(shader);
- shader->unref();
+ paint.setShader(shader.get());
paint.setStyle(SkPaint::kFill_Style);
canvas->drawRoundRect(skrect, borderRadius, borderRadius, paint);
paint.setShader(NULL);
@@ -725,12 +725,12 @@ void NativeThemeBase::PaintButton(SkCanvas* canvas,
colors[0] = light_color;
colors[1] = base_color;
- SkShader* shader = SkGradientShader::CreateLinear(
- gradient_bounds, colors, NULL, 2, SkShader::kClamp_TileMode, NULL);
+ skia::RefPtr<SkShader> shader = skia::AdoptRef(
+ SkGradientShader::CreateLinear(
+ gradient_bounds, colors, NULL, 2, SkShader::kClamp_TileMode, NULL));
paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);
- paint.setShader(shader);
- shader->unref();
+ paint.setShader(shader.get());
canvas->drawRoundRect(skrect, SkIntToScalar(1), SkIntToScalar(1), paint);
paint.setShader(NULL);