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

Unified Diff: ui/compositor/layer.h

Issue 12226080: Thread ui transform animations (Closed) Base URL: http://git.chromium.org/chromium/src.git@DefineThreadedLayerAnimationElements
Patch Set: Address review comments Created 7 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
« no previous file with comments | « no previous file | ui/compositor/layer.cc » ('j') | ui/compositor/layer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.h
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index 2c322d08ef1a034aaa6d6fe69db22073f5d96105..9afdafb3aadc92e7402bde8201cde26297cb5e9d 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -116,7 +116,7 @@ class COMPOSITOR_EXPORT Layer
// The transform, relative to the parent.
void SetTransform(const gfx::Transform& transform);
- const gfx::Transform& transform() const { return transform_; }
+ gfx::Transform transform() const;
// Return the target transform if animator is running, or the current
// transform otherwise.
@@ -221,6 +221,13 @@ class COMPOSITOR_EXPORT Layer
const Layer* target,
gfx::Point* point);
+ // Converts a ui::Layer's transform to the transform on the corresponding
+ // cc::Layer.
+ static gfx::Transform ConvertTransformToCCTransform(
+ const gfx::Transform& transform,
+ const gfx::Rect& bounds,
+ float device_scale_factor);
+
// See description in View for details
void SetFillsBoundsOpaquely(bool fills_bounds_opaquely);
bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; }
@@ -330,18 +337,19 @@ class COMPOSITOR_EXPORT Layer
virtual void SetColorFromAnimation(SkColor color) OVERRIDE;
virtual void ScheduleDrawForAnimation() OVERRIDE;
virtual const gfx::Rect& GetBoundsForAnimation() const OVERRIDE;
- virtual const gfx::Transform& GetTransformForAnimation() const OVERRIDE;
+ virtual gfx::Transform GetTransformForAnimation() const OVERRIDE;
virtual float GetOpacityForAnimation() const OVERRIDE;
virtual bool GetVisibilityForAnimation() const OVERRIDE;
virtual float GetBrightnessForAnimation() const OVERRIDE;
virtual float GetGrayscaleForAnimation() const OVERRIDE;
virtual SkColor GetColorForAnimation() const OVERRIDE;
+ virtual float GetDeviceScaleFactor() const OVERRIDE;
virtual void AddThreadedAnimation(
scoped_ptr<cc::Animation> animation) OVERRIDE;
virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE;
void CreateWebLayer();
- void RecomputeTransform();
+ void RecomputeCCTransformFromTransform(const gfx::Transform& transform);
void RecomputeDrawsContentAndUVRect();
// Set all filters which got applied to the layer.
@@ -363,8 +371,6 @@ class COMPOSITOR_EXPORT Layer
// This layer's children, in bottom-to-top stacking order.
std::vector<Layer*> children_;
- gfx::Transform transform_;
-
gfx::Rect bounds_;
// Visibility of this layer. See SetVisible/IsDrawn for more details.
« no previous file with comments | « no previous file | ui/compositor/layer.cc » ('j') | ui/compositor/layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698