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

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

Issue 7769001: Adds support for point conversions to ui::Layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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.gyp ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer.h
===================================================================
--- ui/gfx/compositor/layer.h (revision 98650)
+++ ui/gfx/compositor/layer.h (working copy)
@@ -44,6 +44,9 @@
const Layer* parent() const { return parent_; }
Layer* parent() { return parent_; }
+ // Returns true if this Layer contains |other| somewhere in its children.
+ bool Contains(const Layer* other) const;
+
// The transform, relative to the parent.
void SetTransform(const ui::Transform& transform);
const ui::Transform& transform() const { return transform_; }
@@ -52,6 +55,13 @@
void SetBounds(const gfx::Rect& bounds);
const gfx::Rect& bounds() const { return bounds_; }
+ // Converts a point from the coordinates of |source| to the coordinates of
+ // |target|. Necessarily, |source| and |target| must inhabit the same Layer
+ // tree.
+ static void ConvertPointToLayer(const Layer* source,
+ const Layer* target,
+ gfx::Point* point);
+
// See description in View for details
void SetFillsBoundsOpaquely(bool fills_bounds_opaquely);
bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; }
@@ -102,6 +112,12 @@
// view has no transfrom with respect to its parent.
void RecomputeHole();
+ bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const;
+ bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const;
+
+ bool GetTransformRelativeTo(const Layer* ancestor,
+ Transform* transform) const;
+
Compositor* compositor_;
scoped_refptr<ui::Texture> texture_;
« no previous file with comments | « ui/gfx/compositor/compositor.gyp ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698