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

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: Speed up animations in WebContentsViewAuraTest.QuickOverscrollDirectionChange Created 7 years, 9 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 | « content/browser/web_contents/web_contents_view_aura_browsertest.cc ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »
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 e416e80dbb0b059274135d92b4083fcc35a9ddc5..a1c0a36c083c3aada6cca9ef052804a2a234a31e 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -121,7 +121,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.
@@ -226,6 +226,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_; }
@@ -343,18 +350,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.
@@ -384,8 +392,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 | « content/browser/web_contents/web_contents_view_aura_browsertest.cc ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698