| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 SkColor background_color() const { return background_color_; } | 122 SkColor background_color() const { return background_color_; } |
| 123 // If contents_opaque(), return an opaque color else return a | 123 // If contents_opaque(), return an opaque color else return a |
| 124 // non-opaque color. Tries to return background_color(), if possible. | 124 // non-opaque color. Tries to return background_color(), if possible. |
| 125 SkColor SafeOpaqueBackgroundColor() const; | 125 SkColor SafeOpaqueBackgroundColor() const; |
| 126 | 126 |
| 127 // A layer's bounds are in logical, non-page-scaled pixels (however, the | 127 // A layer's bounds are in logical, non-page-scaled pixels (however, the |
| 128 // root layer's bounds are in physical pixels). | 128 // root layer's bounds are in physical pixels). |
| 129 void SetBounds(const gfx::Size& bounds); | 129 void SetBounds(const gfx::Size& bounds); |
| 130 gfx::Size bounds() const { return bounds_; } | 130 gfx::Size bounds() const { return bounds_; } |
| 131 | 131 |
| 132 // This function is for property tree builder |
| 133 gfx::Vector2dF bounds_delta() const { return gfx::Vector2dF(); } |
| 134 |
| 132 void SetMasksToBounds(bool masks_to_bounds); | 135 void SetMasksToBounds(bool masks_to_bounds); |
| 133 bool masks_to_bounds() const { return masks_to_bounds_; } | 136 bool masks_to_bounds() const { return masks_to_bounds_; } |
| 134 | 137 |
| 135 void SetMaskLayer(Layer* mask_layer); | 138 void SetMaskLayer(Layer* mask_layer); |
| 136 Layer* mask_layer() { return mask_layer_.get(); } | 139 Layer* mask_layer() { return mask_layer_.get(); } |
| 137 const Layer* mask_layer() const { return mask_layer_.get(); } | 140 const Layer* mask_layer() const { return mask_layer_.get(); } |
| 138 | 141 |
| 139 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); | 142 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); |
| 140 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } | 143 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } |
| 141 | 144 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); | 267 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); |
| 265 void SetScrollCompensationAdjustment( | 268 void SetScrollCompensationAdjustment( |
| 266 const gfx::Vector2dF& scroll_compensation_adjustment); | 269 const gfx::Vector2dF& scroll_compensation_adjustment); |
| 267 gfx::Vector2dF ScrollCompensationAdjustment() const; | 270 gfx::Vector2dF ScrollCompensationAdjustment() const; |
| 268 | 271 |
| 269 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } | 272 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } |
| 270 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); | 273 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); |
| 271 | 274 |
| 272 void SetScrollClipLayerId(int clip_layer_id); | 275 void SetScrollClipLayerId(int clip_layer_id); |
| 273 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } | 276 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } |
| 277 Layer* scroll_clip_layer() const; |
| 278 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } |
| 274 | 279 |
| 275 void SetUserScrollable(bool horizontal, bool vertical); | 280 void SetUserScrollable(bool horizontal, bool vertical); |
| 276 bool user_scrollable_horizontal() const { | 281 bool user_scrollable_horizontal() const { |
| 277 return user_scrollable_horizontal_; | 282 return user_scrollable_horizontal_; |
| 278 } | 283 } |
| 279 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } | 284 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } |
| 280 | 285 |
| 281 void AddMainThreadScrollingReasons(uint32_t main_thread_scrolling_reasons); | 286 void AddMainThreadScrollingReasons(uint32_t main_thread_scrolling_reasons); |
| 282 void ClearMainThreadScrollingReasons(); | 287 void ClearMainThreadScrollingReasons(); |
| 283 uint32_t main_thread_scrolling_reasons() const { | 288 uint32_t main_thread_scrolling_reasons() const { |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 | 795 |
| 791 std::vector<FrameTimingRequest> frame_timing_requests_; | 796 std::vector<FrameTimingRequest> frame_timing_requests_; |
| 792 bool frame_timing_requests_dirty_; | 797 bool frame_timing_requests_dirty_; |
| 793 | 798 |
| 794 DISALLOW_COPY_AND_ASSIGN(Layer); | 799 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 795 }; | 800 }; |
| 796 | 801 |
| 797 } // namespace cc | 802 } // namespace cc |
| 798 | 803 |
| 799 #endif // CC_LAYERS_LAYER_H_ | 804 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |