OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/wm/overview/window_grid.h" | 5 #include "ash/common/wm/overview/window_grid.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 border_rect_f.Scale(scale); | 175 border_rect_f.Scale(scale); |
176 const float inset = border_thickness_ * scale - 0.5f; | 176 const float inset = border_thickness_ * scale - 0.5f; |
177 border_rect_f.Inset(inset, inset); | 177 border_rect_f.Inset(inset, inset); |
178 | 178 |
179 SkPath path; | 179 SkPath path; |
180 const SkScalar scaled_corner_radius = | 180 const SkScalar scaled_corner_radius = |
181 SkFloatToScalar(corner_radius_ * scale + 0.5f); | 181 SkFloatToScalar(corner_radius_ * scale + 0.5f); |
182 path.addRoundRect(gfx::RectFToSkRect(border_rect_f), scaled_corner_radius, | 182 path.addRoundRect(gfx::RectFToSkRect(border_rect_f), scaled_corner_radius, |
183 scaled_corner_radius); | 183 scaled_corner_radius); |
184 | 184 |
185 SkPaint flags; | 185 cc::PaintFlags flags; |
186 flags.setStyle(SkPaint::kStroke_Style); | 186 flags.setStyle(cc::PaintFlags::kStroke_Style); |
187 flags.setStrokeWidth(1); | 187 flags.setStrokeWidth(1); |
188 flags.setAntiAlias(true); | 188 flags.setAntiAlias(true); |
189 | 189 |
190 SkPath stroke_path; | 190 SkPath stroke_path; |
191 flags.getFillPath(path, &stroke_path); | 191 flags.getFillPath(path, &stroke_path); |
192 | 192 |
193 SkPath fill_path; | 193 SkPath fill_path; |
194 Op(path, stroke_path, kDifference_SkPathOp, &fill_path); | 194 Op(path, stroke_path, kDifference_SkPathOp, &fill_path); |
195 flags.setStyle(SkPaint::kFill_Style); | 195 flags.setStyle(cc::PaintFlags::kFill_Style); |
196 flags.setColor(get_color()); | 196 flags.setColor(get_color()); |
197 canvas->sk_canvas()->drawPath(fill_path, flags); | 197 canvas->sk_canvas()->drawPath(fill_path, flags); |
198 | 198 |
199 if (border_thickness_ > 0) { | 199 if (border_thickness_ > 0) { |
200 flags.setColor(border_color_); | 200 flags.setColor(border_color_); |
201 canvas->sk_canvas()->drawPath(stroke_path, flags); | 201 canvas->sk_canvas()->drawPath(stroke_path, flags); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 // Returns the vector for the fade in animation. | 205 // Returns the vector for the fade in animation. |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 *min_right = left; | 840 *min_right = left; |
841 if (*max_right < left) | 841 if (*max_right < left) |
842 *max_right = left; | 842 *max_right = left; |
843 } | 843 } |
844 *max_bottom = top + height; | 844 *max_bottom = top + height; |
845 } | 845 } |
846 return windows_fit; | 846 return windows_fit; |
847 } | 847 } |
848 | 848 |
849 } // namespace ash | 849 } // namespace ash |
OLD | NEW |