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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 views::View::OnPaint(canvas); | 112 views::View::OnPaint(canvas); |
113 | 113 |
114 SkScalar radius = SkIntToScalar(corner_radius_); | 114 SkScalar radius = SkIntToScalar(corner_radius_); |
115 const SkScalar kRadius[8] = {radius, radius, radius, radius, | 115 const SkScalar kRadius[8] = {radius, radius, radius, radius, |
116 radius, radius, radius, radius}; | 116 radius, radius, radius, radius}; |
117 SkPath path; | 117 SkPath path; |
118 gfx::Rect bounds(size()); | 118 gfx::Rect bounds(size()); |
119 bounds.set_height(bounds.height() + radius); | 119 bounds.set_height(bounds.height() + radius); |
120 path.addRoundRect(gfx::RectToSkRect(bounds), kRadius); | 120 path.addRoundRect(gfx::RectToSkRect(bounds), kRadius); |
121 | 121 |
122 SkPaint paint; | 122 cc::PaintFlags paint; |
123 paint.setAntiAlias(true); | 123 paint.setAntiAlias(true); |
124 canvas->ClipPath(path, true); | 124 canvas->ClipPath(path, true); |
125 canvas->DrawColor(background_); | 125 canvas->DrawColor(background_); |
126 } | 126 } |
127 | 127 |
128 private: | 128 private: |
129 int corner_radius_; | 129 int corner_radius_; |
130 SkColor background_; | 130 SkColor background_; |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(RoundedRectView); | 132 DISALLOW_COPY_AND_ASSIGN(RoundedRectView); |
(...skipping 707 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 |