summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorreed <reed@google.com>2016-03-11 04:59:03 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-11 13:00:21 +0000
commit642d8f97282ddbdb26f76ae6773e8bc459b4b15b (patch)
treed136e6ec545c7e1aa66ad1e1417c85df9377db02 /ash
parentccb033d86c3371aa90b079b7bac879fd536e02ad (diff)
downloadchromium_src-642d8f97282ddbdb26f76ae6773e8bc459b4b15b.zip
chromium_src-642d8f97282ddbdb26f76ae6773e8bc459b4b15b.tar.gz
chromium_src-642d8f97282ddbdb26f76ae6773e8bc459b4b15b.tar.bz2
Begin switch-over to using sk_sp (for SkShader for now)
This is not a complete conversion of setShader() sites, but is intended to be a canary, to tryout the new patterns. More will follow once this is approved. BUG=skia:5077 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1778913002 Cr-Commit-Position: refs/heads/master@{#380613}
Diffstat (limited to 'ash')
-rw-r--r--ash/touch/touch_hud_projection.cc12
-rw-r--r--ash/wm/gestures/long_press_affordance_handler.cc11
2 files changed, 8 insertions, 15 deletions
diff --git a/ash/touch/touch_hud_projection.cc b/ash/touch/touch_hud_projection.cc
index af38df2..277cdd8 100644
--- a/ash/touch/touch_hud_projection.cc
+++ b/ash/touch/touch_hud_projection.cc
@@ -85,14 +85,10 @@ class TouchPointView : public views::View,
alpha = static_cast<int>(fadeout_->CurrentValueBetween(alpha, 0));
fill_paint_.setAlpha(alpha);
stroke_paint_.setAlpha(alpha);
- skia::RefPtr<SkShader> shader = skia::AdoptRef(
- SkGradientShader::CreateRadial(gradient_center_,
- SkIntToScalar(kPointRadius),
- gradient_colors_,
- gradient_pos_,
- arraysize(gradient_colors_),
- SkShader::kMirror_TileMode));
- fill_paint_.setShader(shader.get());
+ fill_paint_.setShader(SkGradientShader::MakeRadial(
+ gradient_center_, SkIntToScalar(kPointRadius), gradient_colors_,
+ gradient_pos_, arraysize(gradient_colors_),
+ SkShader::kMirror_TileMode));
canvas->DrawCircle(circle_center_, SkIntToScalar(kPointRadius),
fill_paint_);
canvas->DrawCircle(circle_center_, SkIntToScalar(kPointRadius),
diff --git a/ash/wm/gestures/long_press_affordance_handler.cc b/ash/wm/gestures/long_press_affordance_handler.cc
index eafa30d..a6c3f07 100644
--- a/ash/wm/gestures/long_press_affordance_handler.cc
+++ b/ash/wm/gestures/long_press_affordance_handler.cc
@@ -103,16 +103,13 @@ void PaintAffordanceGlow(gfx::Canvas* canvas,
int radius = (end_radius + start_radius) / 2;
int glow_width = end_radius - start_radius;
SkPoint sk_center(PointToSkPoint(center));
- skia::RefPtr<SkShader> shader =
- skia::AdoptRef(SkGradientShader::CreateTwoPointConical(
- sk_center, SkIntToScalar(start_radius), sk_center,
- SkIntToScalar(end_radius), colors, pos, num_colors,
- SkShader::kClamp_TileMode));
- DCHECK(shader);
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(glow_width);
- paint.setShader(shader.get());
+ paint.setShader(SkGradientShader::MakeTwoPointConical(
+ sk_center, SkIntToScalar(start_radius), sk_center,
+ SkIntToScalar(end_radius), colors, pos, num_colors,
+ SkShader::kClamp_TileMode));
paint.setAntiAlias(true);
SkPath arc_path;
arc_path.addArc(SkRect::MakeXYWH(center.x() - radius,