| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 CC_LAYERS_LAYER_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
| 6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } | 512 } |
| 513 | 513 |
| 514 const gfx::Rect& visible_layer_rect() const { return visible_layer_rect_; } | 514 const gfx::Rect& visible_layer_rect() const { return visible_layer_rect_; } |
| 515 void set_visible_layer_rect(const gfx::Rect& rect) { | 515 void set_visible_layer_rect(const gfx::Rect& rect) { |
| 516 visible_layer_rect_ = rect; | 516 visible_layer_rect_ = rect; |
| 517 } | 517 } |
| 518 | 518 |
| 519 const gfx::Rect& clip_rect() const { return clip_rect_; } | 519 const gfx::Rect& clip_rect() const { return clip_rect_; } |
| 520 void set_clip_rect(const gfx::Rect& rect) { clip_rect_ = rect; } | 520 void set_clip_rect(const gfx::Rect& rect) { clip_rect_ = rect; } |
| 521 | 521 |
| 522 // This should only be called during BeginMainFrame since it does not trigger |
| 523 // a Commit. This is called right after property tree being built and should |
| 524 // not trigger property tree rebuild. |
| 525 void SetHasRenderSurface(bool has_render_surface); |
| 522 bool has_render_surface() const { | 526 bool has_render_surface() const { |
| 523 return has_render_surface_; | 527 return has_render_surface_; |
| 524 } | 528 } |
| 525 | 529 |
| 526 // Sets new frame timing requests for this layer. | 530 // Sets new frame timing requests for this layer. |
| 527 void SetFrameTimingRequests(const std::vector<FrameTimingRequest>& requests); | 531 void SetFrameTimingRequests(const std::vector<FrameTimingRequest>& requests); |
| 528 | 532 |
| 529 // Accessor for unit tests | 533 // Accessor for unit tests |
| 530 const std::vector<FrameTimingRequest>& FrameTimingRequests() const { | 534 const std::vector<FrameTimingRequest>& FrameTimingRequests() const { |
| 531 return frame_timing_requests_; | 535 return frame_timing_requests_; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 // space. 0 is a special value that means this layer will not be sorted and | 664 // space. 0 is a special value that means this layer will not be sorted and |
| 661 // will be drawn in paint order. | 665 // will be drawn in paint order. |
| 662 int sorting_context_id_; | 666 int sorting_context_id_; |
| 663 | 667 |
| 664 private: | 668 private: |
| 665 friend class base::RefCounted<Layer>; | 669 friend class base::RefCounted<Layer>; |
| 666 friend class LayerTreeHostCommon; | 670 friend class LayerTreeHostCommon; |
| 667 void SetParent(Layer* layer); | 671 void SetParent(Layer* layer); |
| 668 bool DescendantIsFixedToContainerLayer() const; | 672 bool DescendantIsFixedToContainerLayer() const; |
| 669 | 673 |
| 670 // This should only be called during BeginMainFrame since it does not | |
| 671 // trigger a Commit. | |
| 672 void SetHasRenderSurface(bool has_render_surface); | |
| 673 | |
| 674 // This should only be called from RemoveFromParent(). | 674 // This should only be called from RemoveFromParent(). |
| 675 void RemoveChildOrDependent(Layer* child); | 675 void RemoveChildOrDependent(Layer* child); |
| 676 | 676 |
| 677 // If this layer has a scroll parent, it removes |this| from its list of | 677 // If this layer has a scroll parent, it removes |this| from its list of |
| 678 // scroll children. | 678 // scroll children. |
| 679 void RemoveFromScrollTree(); | 679 void RemoveFromScrollTree(); |
| 680 | 680 |
| 681 // If this layer has a clip parent, it removes |this| from its list of clip | 681 // If this layer has a clip parent, it removes |this| from its list of clip |
| 682 // children. | 682 // children. |
| 683 void RemoveFromClipTree(); | 683 void RemoveFromClipTree(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 783 |
| 784 std::vector<FrameTimingRequest> frame_timing_requests_; | 784 std::vector<FrameTimingRequest> frame_timing_requests_; |
| 785 bool frame_timing_requests_dirty_; | 785 bool frame_timing_requests_dirty_; |
| 786 | 786 |
| 787 DISALLOW_COPY_AND_ASSIGN(Layer); | 787 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 788 }; | 788 }; |
| 789 | 789 |
| 790 } // namespace cc | 790 } // namespace cc |
| 791 | 791 |
| 792 #endif // CC_LAYERS_LAYER_H_ | 792 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |