| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_COMPOSITOR_LAYER_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_H_ |
| 6 #define UI_COMPOSITOR_LAYER_H_ | 6 #define UI_COMPOSITOR_LAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // Returns true if this layer can have a texture (has_texture_ is true) | 257 // Returns true if this layer can have a texture (has_texture_ is true) |
| 258 // and is not completely obscured by a child. | 258 // and is not completely obscured by a child. |
| 259 bool ShouldDraw() const; | 259 bool ShouldDraw() const; |
| 260 | 260 |
| 261 // Converts a point from the coordinates of |source| to the coordinates of | 261 // Converts a point from the coordinates of |source| to the coordinates of |
| 262 // |target|. Necessarily, |source| and |target| must inhabit the same Layer | 262 // |target|. Necessarily, |source| and |target| must inhabit the same Layer |
| 263 // tree. | 263 // tree. |
| 264 static void ConvertPointToLayer(const Layer* source, | 264 static void ConvertPointToLayer(const Layer* source, |
| 265 const Layer* target, | 265 const Layer* target, |
| 266 gfx::Point* point); | 266 gfx::Point* point); |
| 267 static void ConvertPointToLayerF(const Layer* source, |
| 268 const Layer* target, |
| 269 gfx::PointF* point); |
| 267 | 270 |
| 268 // Converts a transform to be relative to the given |ancestor|. Returns | 271 // Converts a transform to be relative to the given |ancestor|. Returns |
| 269 // whether success (that is, whether the given ancestor was really an | 272 // whether success (that is, whether the given ancestor was really an |
| 270 // ancestor of this layer). | 273 // ancestor of this layer). |
| 271 bool GetTargetTransformRelativeTo(const Layer* ancestor, | 274 bool GetTargetTransformRelativeTo(const Layer* ancestor, |
| 272 gfx::Transform* transform) const; | 275 gfx::Transform* transform) const; |
| 273 | 276 |
| 274 // See description in View for details | 277 // See description in View for details |
| 275 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); | 278 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); |
| 276 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } | 279 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 class LayerMirror; | 396 class LayerMirror; |
| 394 | 397 |
| 395 void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators); | 398 void CollectAnimators(std::vector<scoped_refptr<LayerAnimator> >* animators); |
| 396 | 399 |
| 397 // Stacks |child| above or below |other|. Helper method for StackAbove() and | 400 // Stacks |child| above or below |other|. Helper method for StackAbove() and |
| 398 // StackBelow(). | 401 // StackBelow(). |
| 399 void StackRelativeTo(Layer* child, Layer* other, bool above); | 402 void StackRelativeTo(Layer* child, Layer* other, bool above); |
| 400 | 403 |
| 401 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; | 404 bool ConvertPointForAncestor(const Layer* ancestor, gfx::Point* point) const; |
| 402 bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; | 405 bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; |
| 406 bool ConvertPointForAncestorF(const Layer* ancestor, |
| 407 gfx::PointF* point) const; |
| 408 bool ConvertPointFromAncestorF(const Layer* ancestor, |
| 409 gfx::PointF* point) const; |
| 403 | 410 |
| 404 // Implementation of LayerAnimatorDelegate | 411 // Implementation of LayerAnimatorDelegate |
| 405 void SetBoundsFromAnimation(const gfx::Rect& bounds) override; | 412 void SetBoundsFromAnimation(const gfx::Rect& bounds) override; |
| 406 void SetTransformFromAnimation(const gfx::Transform& transform) override; | 413 void SetTransformFromAnimation(const gfx::Transform& transform) override; |
| 407 void SetOpacityFromAnimation(float opacity) override; | 414 void SetOpacityFromAnimation(float opacity) override; |
| 408 void SetVisibilityFromAnimation(bool visibility) override; | 415 void SetVisibilityFromAnimation(bool visibility) override; |
| 409 void SetBrightnessFromAnimation(float brightness) override; | 416 void SetBrightnessFromAnimation(float brightness) override; |
| 410 void SetGrayscaleFromAnimation(float grayscale) override; | 417 void SetGrayscaleFromAnimation(float grayscale) override; |
| 411 void SetColorFromAnimation(SkColor color) override; | 418 void SetColorFromAnimation(SkColor color) override; |
| 412 void ScheduleDrawForAnimation() override; | 419 void ScheduleDrawForAnimation() override; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 544 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
| 538 // or SetTextureMailbox was called. | 545 // or SetTextureMailbox was called. |
| 539 gfx::Size frame_size_in_dip_; | 546 gfx::Size frame_size_in_dip_; |
| 540 | 547 |
| 541 DISALLOW_COPY_AND_ASSIGN(Layer); | 548 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 542 }; | 549 }; |
| 543 | 550 |
| 544 } // namespace ui | 551 } // namespace ui |
| 545 | 552 |
| 546 #endif // UI_COMPOSITOR_LAYER_H_ | 553 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |