| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 SetNativeControlColor(background); | 204 SetNativeControlColor(background); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void BackgroundWith1PxBorder::Paint(gfx::Canvas* canvas, | 207 void BackgroundWith1PxBorder::Paint(gfx::Canvas* canvas, |
| 208 views::View* view) const { | 208 views::View* view) const { |
| 209 gfx::RectF border_rect_f(view->GetContentsBounds()); | 209 gfx::RectF border_rect_f(view->GetContentsBounds()); |
| 210 | 210 |
| 211 gfx::ScopedCanvas scoped_canvas(canvas); | 211 gfx::ScopedCanvas scoped_canvas(canvas); |
| 212 const float scale = canvas->UndoDeviceScaleFactor(); | 212 const float scale = canvas->UndoDeviceScaleFactor(); |
| 213 border_rect_f.Scale(scale); | 213 border_rect_f.Scale(scale); |
| 214 if (border_thickness_ > 0) { | 214 const float inset = border_thickness_ * scale - 0.5f; |
| 215 const float inset = border_thickness_ * scale - 0.5f; | 215 border_rect_f.Inset(inset, inset); |
| 216 border_rect_f.Inset(inset, inset); | |
| 217 } | |
| 218 | 216 |
| 219 SkPath path; | 217 SkPath path; |
| 220 const SkScalar scaled_corner_radius = | 218 const SkScalar scaled_corner_radius = |
| 221 SkFloatToScalar(corner_radius_ * scale + 0.5f); | 219 SkFloatToScalar(corner_radius_ * scale + 0.5f); |
| 222 path.addRoundRect(gfx::RectFToSkRect(border_rect_f), scaled_corner_radius, | 220 path.addRoundRect(gfx::RectFToSkRect(border_rect_f), scaled_corner_radius, |
| 223 scaled_corner_radius); | 221 scaled_corner_radius); |
| 224 | 222 |
| 225 SkPaint paint; | 223 SkPaint paint; |
| 226 paint.setStyle(SkPaint::kStroke_Style); | 224 paint.setStyle(SkPaint::kStroke_Style); |
| 227 paint.setStrokeWidth(1); | 225 paint.setStrokeWidth(1); |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 *min_right = left; | 943 *min_right = left; |
| 946 if (*max_right < left) | 944 if (*max_right < left) |
| 947 *max_right = left; | 945 *max_right = left; |
| 948 } | 946 } |
| 949 *max_bottom = top + height; | 947 *max_bottom = top + height; |
| 950 } | 948 } |
| 951 return windows_fit; | 949 return windows_fit; |
| 952 } | 950 } |
| 953 | 951 |
| 954 } // namespace ash | 952 } // namespace ash |
| OLD | NEW |