| OLD | NEW |
| 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 "ash/wm/gestures/long_press_affordance_handler.h" | 5 #include "ash/wm/gestures/long_press_affordance_handler.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 gfx::Point& center, | 98 gfx::Point& center, |
| 99 int start_radius, | 99 int start_radius, |
| 100 int end_radius, | 100 int end_radius, |
| 101 SkColor* colors, | 101 SkColor* colors, |
| 102 SkScalar* pos, | 102 SkScalar* pos, |
| 103 int num_colors) { | 103 int num_colors) { |
| 104 SkPoint sk_center; | 104 SkPoint sk_center; |
| 105 int radius = (end_radius + start_radius) / 2; | 105 int radius = (end_radius + start_radius) / 2; |
| 106 int glow_width = end_radius - start_radius; | 106 int glow_width = end_radius - start_radius; |
| 107 sk_center.iset(center.x(), center.y()); | 107 sk_center.iset(center.x(), center.y()); |
| 108 SkShader* shader = SkGradientShader::CreateTwoPointRadial( | 108 skia::RefPtr<SkShader> shader = SkGradientShader::CreateTwoPointRadial( |
| 109 sk_center, | 109 sk_center, |
| 110 SkIntToScalar(start_radius), | 110 SkIntToScalar(start_radius), |
| 111 sk_center, | 111 sk_center, |
| 112 SkIntToScalar(end_radius), | 112 SkIntToScalar(end_radius), |
| 113 colors, | 113 colors, |
| 114 pos, | 114 pos, |
| 115 num_colors, | 115 num_colors, |
| 116 SkShader::kClamp_TileMode); | 116 SkShader::kClamp_TileMode); |
| 117 DCHECK(shader); | 117 DCHECK(shader); |
| 118 SkPaint paint; | 118 SkPaint paint; |
| 119 paint.setStyle(SkPaint::kStroke_Style); | 119 paint.setStyle(SkPaint::kStroke_Style); |
| 120 paint.setStrokeWidth(glow_width); | 120 paint.setStrokeWidth(glow_width); |
| 121 paint.setShader(shader); | 121 paint.setShader(shader.get()); |
| 122 paint.setAntiAlias(true); | 122 paint.setAntiAlias(true); |
| 123 shader->unref(); | |
| 124 SkPath arc_path; | 123 SkPath arc_path; |
| 125 arc_path.addArc(SkRect::MakeXYWH(center.x() - radius, | 124 arc_path.addArc(SkRect::MakeXYWH(center.x() - radius, |
| 126 center.y() - radius, | 125 center.y() - radius, |
| 127 2 * radius, | 126 2 * radius, |
| 128 2 * radius), | 127 2 * radius), |
| 129 0, 360); | 128 0, 360); |
| 130 canvas->DrawPath(arc_path, paint); | 129 canvas->DrawPath(arc_path, paint); |
| 131 } | 130 } |
| 132 | 131 |
| 133 } // namespace | 132 } // namespace |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 default: | 368 default: |
| 370 view_.reset(); | 369 view_.reset(); |
| 371 tap_down_touch_id_ = -1; | 370 tap_down_touch_id_ = -1; |
| 372 tap_down_display_id_ = 0; | 371 tap_down_display_id_ = 0; |
| 373 break; | 372 break; |
| 374 } | 373 } |
| 375 } | 374 } |
| 376 | 375 |
| 377 } // namespace internal | 376 } // namespace internal |
| 378 } // namespace ash | 377 } // namespace ash |
| OLD | NEW |