diff options
Diffstat (limited to 'views/view.cc')
-rw-r--r-- | views/view.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/views/view.cc b/views/view.cc index 1e1cd20..34ec1c3 100644 --- a/views/view.cc +++ b/views/view.cc @@ -429,14 +429,12 @@ 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) - GdkRegion* region = mask.CreateGdkRegion(); - bool result = gdk_region_point_in(region, l.x(), l.y()); - gdk_region_destroy(region); - return result; + return gdk_region_point_in(rgn.Get(), l.x(), l.y()); #endif } // No mask, but inside our bounds. |