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

Unified Diff: ui/aura/window.cc

Issue 173443002: aura: Take transformation into account when computing window bounds in root-window/screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index df66b704f488409810c4598b5c33c1db1f34abf5..8dd758bcad107a2e28f0290a118053f804df1497 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -383,11 +383,15 @@ gfx::Rect Window::GetBoundsInRootWindow() const {
// TODO(beng): There may be a better way to handle this, and the existing code
// is likely wrong anyway in a multi-display world, but this will
// do for now.
- if (!GetRootWindow())
+ const Window* root = GetRootWindow();
+ if (!root)
return bounds();
- gfx::Point origin = bounds().origin();
- ConvertPointToTarget(parent_, GetRootWindow(), &origin);
- return gfx::Rect(origin, bounds().size());
+ gfx::Transform transform;
+ if (!layer()->GetTargetTransformRelativeTo(root->layer(), &transform))
+ return gfx::Rect();
+ gfx::RectF rect(bounds().size());
+ transform.TransformRect(&rect);
oshima 2014/02/20 19:39:35 While I understand the motivation and the current
sadrul 2014/02/20 19:59:59 If there are such cases, perhaps we should find an
oshima 2014/02/20 20:18:51 I think the reason is that such scenario is rare (
sadrul 2014/02/20 21:53:48 Indeed. The motivation from this patch is from her
+ return gfx::ToEnclosingRect(rect);
}
gfx::Rect Window::GetBoundsInScreen() const {

Powered by Google App Engine
This is Rietveld 408576698