| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 DCHECK(!draw_properties_.render_target || | 259 DCHECK(!draw_properties_.render_target || |
| 260 draw_properties_.render_target->render_surface()); | 260 draw_properties_.render_target->render_surface()); |
| 261 return draw_properties_.render_target; | 261 return draw_properties_.render_target; |
| 262 } | 262 } |
| 263 int num_unclipped_descendants() const { | 263 int num_unclipped_descendants() const { |
| 264 return draw_properties_.num_unclipped_descendants; | 264 return draw_properties_.num_unclipped_descendants; |
| 265 } | 265 } |
| 266 | 266 |
| 267 RenderSurface* render_surface() const { return render_surface_.get(); } | 267 RenderSurface* render_surface() const { return render_surface_.get(); } |
| 268 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); | 268 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); |
| 269 void SetScrollCompensationAdjustment( |
| 270 const gfx::Vector2dF& scroll_compensation_adjustment); |
| 271 gfx::Vector2dF ScrollCompensationAdjustment() const; |
| 272 |
| 269 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } | 273 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } |
| 270 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); | 274 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); |
| 271 | 275 |
| 272 void SetScrollClipLayerId(int clip_layer_id); | 276 void SetScrollClipLayerId(int clip_layer_id); |
| 273 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } | 277 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } |
| 274 | 278 |
| 275 void SetUserScrollable(bool horizontal, bool vertical); | 279 void SetUserScrollable(bool horizontal, bool vertical); |
| 276 bool user_scrollable_horizontal() const { | 280 bool user_scrollable_horizontal() const { |
| 277 return user_scrollable_horizontal_; | 281 return user_scrollable_horizontal_; |
| 278 } | 282 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 307 | 311 |
| 308 void SetDrawCheckerboardForMissingTiles(bool checkerboard); | 312 void SetDrawCheckerboardForMissingTiles(bool checkerboard); |
| 309 bool draw_checkerboard_for_missing_tiles() const { | 313 bool draw_checkerboard_for_missing_tiles() const { |
| 310 return draw_checkerboard_for_missing_tiles_; | 314 return draw_checkerboard_for_missing_tiles_; |
| 311 } | 315 } |
| 312 | 316 |
| 313 void SetForceRenderSurface(bool force_render_surface); | 317 void SetForceRenderSurface(bool force_render_surface); |
| 314 bool force_render_surface() const { return force_render_surface_; } | 318 bool force_render_surface() const { return force_render_surface_; } |
| 315 | 319 |
| 316 gfx::Vector2dF ScrollDelta() const { return gfx::Vector2dF(); } | 320 gfx::Vector2dF ScrollDelta() const { return gfx::Vector2dF(); } |
| 317 gfx::ScrollOffset TotalScrollOffset() const { | 321 gfx::ScrollOffset CurrentScrollOffset() const { return scroll_offset_; } |
| 318 return ScrollOffsetWithDelta(scroll_offset(), ScrollDelta()); | |
| 319 } | |
| 320 | 322 |
| 321 void SetDoubleSided(bool double_sided); | 323 void SetDoubleSided(bool double_sided); |
| 322 bool double_sided() const { return double_sided_; } | 324 bool double_sided() const { return double_sided_; } |
| 323 | 325 |
| 324 void SetShouldFlattenTransform(bool flatten); | 326 void SetShouldFlattenTransform(bool flatten); |
| 325 bool should_flatten_transform() const { return should_flatten_transform_; } | 327 bool should_flatten_transform() const { return should_flatten_transform_; } |
| 326 | 328 |
| 327 bool Is3dSorted() const { return sorting_context_id_ != 0; } | 329 bool Is3dSorted() const { return sorting_context_id_ != 0; } |
| 328 | 330 |
| 329 void set_use_parent_backface_visibility(bool use) { | 331 void set_use_parent_backface_visibility(bool use) { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // This pointer value is nil when a Layer is not in a tree and is | 631 // This pointer value is nil when a Layer is not in a tree and is |
| 630 // updated via SetLayerTreeHost() if a layer moves between trees. | 632 // updated via SetLayerTreeHost() if a layer moves between trees. |
| 631 LayerTreeHost* layer_tree_host_; | 633 LayerTreeHost* layer_tree_host_; |
| 632 | 634 |
| 633 scoped_refptr<LayerAnimationController> layer_animation_controller_; | 635 scoped_refptr<LayerAnimationController> layer_animation_controller_; |
| 634 | 636 |
| 635 // Layer properties. | 637 // Layer properties. |
| 636 gfx::Size bounds_; | 638 gfx::Size bounds_; |
| 637 | 639 |
| 638 gfx::ScrollOffset scroll_offset_; | 640 gfx::ScrollOffset scroll_offset_; |
| 641 gfx::Vector2dF scroll_compensation_adjustment_; |
| 639 // This variable indicates which ancestor layer (if any) whose size, | 642 // This variable indicates which ancestor layer (if any) whose size, |
| 640 // transformed relative to this layer, defines the maximum scroll offset for | 643 // transformed relative to this layer, defines the maximum scroll offset for |
| 641 // this layer. | 644 // this layer. |
| 642 int scroll_clip_layer_id_; | 645 int scroll_clip_layer_id_; |
| 643 int num_descendants_that_draw_content_; | 646 int num_descendants_that_draw_content_; |
| 644 int transform_tree_index_; | 647 int transform_tree_index_; |
| 645 int opacity_tree_index_; | 648 int opacity_tree_index_; |
| 646 int clip_tree_index_; | 649 int clip_tree_index_; |
| 647 gfx::Vector2dF offset_to_transform_parent_; | 650 gfx::Vector2dF offset_to_transform_parent_; |
| 648 bool should_scroll_on_main_thread_ : 1; | 651 bool should_scroll_on_main_thread_ : 1; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 | 708 |
| 706 std::vector<FrameTimingRequest> frame_timing_requests_; | 709 std::vector<FrameTimingRequest> frame_timing_requests_; |
| 707 bool frame_timing_requests_dirty_; | 710 bool frame_timing_requests_dirty_; |
| 708 | 711 |
| 709 DISALLOW_COPY_AND_ASSIGN(Layer); | 712 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 710 }; | 713 }; |
| 711 | 714 |
| 712 } // namespace cc | 715 } // namespace cc |
| 713 | 716 |
| 714 #endif // CC_LAYERS_LAYER_H_ | 717 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |