OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gfx/path_x11.h" | 5 #include "ui/gfx/path_x11.h" |
6 | 6 |
| 7 #include <X11/Xlib.h> |
| 8 #include <X11/Xregion.h> |
7 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
8 | 10 |
9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
10 #include "third_party/skia/include/core/SkRegion.h" | 12 #include "third_party/skia/include/core/SkRegion.h" |
11 #include "ui/gfx/path.h" | 13 #include "ui/gfx/path.h" |
12 | 14 |
13 namespace gfx { | 15 namespace gfx { |
14 | 16 |
15 Region CreateRegionFromSkRegion(const SkRegion& region) { | 17 Region CreateRegionFromSkRegion(const SkRegion& region) { |
16 Region result = XCreateRegion(); | 18 Region result = XCreateRegion(); |
(...skipping 17 matching lines...) Expand all Loading... |
34 scoped_ptr<XPoint[]> x11_points(new XPoint[point_count]); | 36 scoped_ptr<XPoint[]> x11_points(new XPoint[point_count]); |
35 for (int i = 0; i < point_count; ++i) { | 37 for (int i = 0; i < point_count; ++i) { |
36 x11_points[i].x = SkScalarRoundToInt(points[i].fX); | 38 x11_points[i].x = SkScalarRoundToInt(points[i].fX); |
37 x11_points[i].y = SkScalarRoundToInt(points[i].fY); | 39 x11_points[i].y = SkScalarRoundToInt(points[i].fY); |
38 } | 40 } |
39 | 41 |
40 return XPolygonRegion(x11_points.get(), point_count, EvenOddRule); | 42 return XPolygonRegion(x11_points.get(), point_count, EvenOddRule); |
41 } | 43 } |
42 | 44 |
43 } // namespace gfx | 45 } // namespace gfx |
OLD | NEW |