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

Unified Diff: ui/gfx/compositor/layer.cc

Issue 8417008: aura: Add fullscreen/popups to RenderWidgetHostViewAura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 2 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/gfx/compositor/compositor.h ('k') | views/widget/native_widget_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer.cc
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
index e9a9ed578dfdfde1fab4b94b0af6d50f9d396cec..7c818da8adba4b82365fcf6604f3f5e5eb7e5e19 100644
--- a/ui/gfx/compositor/layer.cc
+++ b/ui/gfx/compositor/layer.cc
@@ -212,19 +212,16 @@ bool Layer::ShouldDraw() const {
void Layer::ConvertPointToLayer(const Layer* source,
const Layer* target,
gfx::Point* point) {
- const Layer* inner = NULL;
- const Layer* outer = NULL;
- if (source->Contains(target)) {
- inner = target;
- outer = source;
- inner->ConvertPointFromAncestor(outer, point);
- } else if (target->Contains(source)) {
- inner = source;
- outer = target;
- inner->ConvertPointForAncestor(outer, point);
- } else {
- NOTREACHED(); // |source| and |target| are in unrelated hierarchies.
- }
+ if (source == target)
+ return;
+
+ const Layer* root_layer = source->compositor()->root_layer();
+ CHECK_EQ(root_layer, target->compositor()->root_layer());
+
+ if (source != root_layer)
+ source->ConvertPointForAncestor(root_layer, point);
+ if (target != root_layer)
+ target->ConvertPointFromAncestor(root_layer, point);
}
void Layer::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) {
« no previous file with comments | « ui/gfx/compositor/compositor.h ('k') | views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698