| Index: ui/gfx/compositor/layer.cc
|
| diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc
|
| index a075137abeb62211f70f3731a316d8815bd33adb..518768a5382179789c6771bcf508e27465cdc205 100644
|
| --- a/ui/gfx/compositor/layer.cc
|
| +++ b/ui/gfx/compositor/layer.cc
|
| @@ -215,19 +215,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) {
|
|
|