Blink roll 174234:174238
[chromium-blink-merge.git] / ui / views / window / window_shape.cc
blob1f6bc13c24c56d6ec3a91b5b3f06fc611ec388c7
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/views/window/window_shape.h"
7 #include "ui/gfx/path.h"
8 #include "ui/gfx/size.h"
10 namespace views {
12 void GetDefaultWindowMask(const gfx::Size &size, gfx::Path *window_mask) {
13 // Redefine the window visible region for the new size.
14 window_mask->moveTo(0, 3);
15 window_mask->lineTo(1, 2);
16 window_mask->lineTo(1, 1);
17 window_mask->lineTo(2, 1);
18 window_mask->lineTo(3, 0);
20 window_mask->lineTo(SkIntToScalar(size.width() - 3), 0);
21 window_mask->lineTo(SkIntToScalar(size.width() - 2), 1);
22 window_mask->lineTo(SkIntToScalar(size.width() - 1), 1);
23 window_mask->lineTo(SkIntToScalar(size.width() - 1), 2);
24 window_mask->lineTo(SkIntToScalar(size.width()), 3);
26 window_mask->lineTo(SkIntToScalar(size.width()),
27 SkIntToScalar(size.height() - 3));
28 window_mask->lineTo(SkIntToScalar(size.width() - 1),
29 SkIntToScalar(size.height() - 3));
30 window_mask->lineTo(SkIntToScalar(size.width() - 1),
31 SkIntToScalar(size.height() - 1));
32 window_mask->lineTo(SkIntToScalar(size.width() - 3),
33 SkIntToScalar(size.height() - 2));
34 window_mask->lineTo(SkIntToScalar(size.width() - 3),
35 SkIntToScalar(size.height()));
37 window_mask->lineTo(3, SkIntToScalar(size.height()));
38 window_mask->lineTo(2, SkIntToScalar(size.height() - 2));
39 window_mask->lineTo(1, SkIntToScalar(size.height() - 1));
40 window_mask->lineTo(1, SkIntToScalar(size.height() - 3));
41 window_mask->lineTo(0, SkIntToScalar(size.height() - 3));
43 window_mask->close();
46 } // namespace views