Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: ui/aura/window.cc

Issue 10566009: app_list: Fix shadow bleeds over launcher button and steals mouse events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix aura_demo compilation Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 1c2554723ede63c285812daa116b96f431580285..62b77883901df9aad1e7eb11921b4e0d8d663753 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -29,6 +29,7 @@
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/path.h"
#include "ui/gfx/screen.h"
namespace aura {
@@ -442,8 +443,19 @@ bool Window::HitTest(const gfx::Point& local_point) {
// probably cheaper to do the math every time than to branch).
gfx::Rect local_bounds(gfx::Point(), bounds().size());
local_bounds.Inset(hit_test_bounds_override_outer_);
- // TODO(beng): hittest masks.
- return local_bounds.Contains(local_point);
+
+ if (!delegate_ || !delegate_->HasHitTestMask())
+ return local_bounds.Contains(local_point);
+
+ gfx::Path mask;
+ delegate_->GetHitTestMask(&mask);
+
+ SkRegion clip_region;
+ clip_region.setRect(local_bounds.x(), local_bounds.y(),
+ local_bounds.width(), local_bounds.height());
+ SkRegion mask_region;
+ return mask_region.setPath(mask, clip_region) &&
+ mask_region.contains(local_point.x(), local_point.y());
}
Window* Window::GetEventHandlerForPoint(const gfx::Point& local_point) {
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698