diff options
Diffstat (limited to 'views/view.cc')
-rw-r--r-- | views/view.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/views/view.cc b/views/view.cc index 34ec1c3..1e1cd20 100644 --- a/views/view.cc +++ b/views/view.cc @@ -429,12 +429,14 @@ bool View::HitTest(const gfx::Point& l) const { if (HasHitTestMask()) { gfx::Path mask; GetHitTestMask(&mask); - ScopedRegion rgn(mask.CreateNativeRegion()); - // TODO: can this use SkRegion's contains instead? #if defined(OS_WIN) + ScopedHRGN rgn(mask.CreateHRGN()); return !!PtInRegion(rgn, l.x(), l.y()); #elif defined(OS_LINUX) - return gdk_region_point_in(rgn.Get(), l.x(), l.y()); + GdkRegion* region = mask.CreateGdkRegion(); + bool result = gdk_region_point_in(region, l.x(), l.y()); + gdk_region_destroy(region); + return result; #endif } // No mask, but inside our bounds. |