summaryrefslogtreecommitdiffstats
path: root/app/gfx/path_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'app/gfx/path_win.cc')
-rw-r--r--app/gfx/path_win.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/app/gfx/path_win.cc b/app/gfx/path_win.cc
index 72fce71..5a337bb 100644
--- a/app/gfx/path_win.cc
+++ b/app/gfx/path_win.cc
@@ -8,7 +8,7 @@
namespace gfx {
-HRGN Path::CreateHRGN() const {
+HRGN Path::CreateNativeRegion() const {
int point_count = getPoints(NULL, 0);
scoped_array<SkPoint> points(new SkPoint[point_count]);
getPoints(points.get(), point_count);
@@ -21,4 +21,25 @@ HRGN Path::CreateHRGN() const {
return ::CreatePolygonRgn(windows_points.get(), point_count, ALTERNATE);
}
+// static
+NativeRegion Path::IntersectRegions(NativeRegion r1, NativeRegion r2) {
+ HRGN dest = CreateRectRgn(0, 0, 1, 1);
+ CombineRgn(dest, r1, r2, RGN_AND);
+ return dest;
+}
+
+// static
+NativeRegion Path::CombineRegions(NativeRegion r1, NativeRegion r2) {
+ HRGN dest = CreateRectRgn(0, 0, 1, 1);
+ CombineRgn(dest, r1, r2, RGN_OR);
+ return dest;
+}
+
+// static
+NativeRegion Path::SubtractRegion(NativeRegion r1, NativeRegion r2) {
+ HRGN dest = CreateRectRgn(0, 0, 1, 1);
+ CombineRgn(dest, r1, r2, RGN_DIFF);
+ return dest;
+}
+
} // namespace gfx