| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void SetPositionConstraint(const LayerPositionConstraint& constraint) { | 260 void SetPositionConstraint(const LayerPositionConstraint& constraint) { |
| 261 position_constraint_ = constraint; | 261 position_constraint_ = constraint; |
| 262 } | 262 } |
| 263 const LayerPositionConstraint& position_constraint() const { | 263 const LayerPositionConstraint& position_constraint() const { |
| 264 return position_constraint_; | 264 return position_constraint_; |
| 265 } | 265 } |
| 266 | 266 |
| 267 void SetShouldFlattenTransform(bool flatten); | 267 void SetShouldFlattenTransform(bool flatten); |
| 268 bool should_flatten_transform() const { return should_flatten_transform_; } | 268 bool should_flatten_transform() const { return should_flatten_transform_; } |
| 269 | 269 |
| 270 void SetIs3dSorted(bool sorted); | 270 bool Is3dSorted() const { return sorting_context_id_ != 0; } |
| 271 bool is_3d_sorted() const { return is_3d_sorted_; } | |
| 272 | 271 |
| 273 void SetUseParentBackfaceVisibility(bool use) { | 272 void SetUseParentBackfaceVisibility(bool use) { |
| 274 use_parent_backface_visibility_ = use; | 273 use_parent_backface_visibility_ = use; |
| 275 } | 274 } |
| 276 bool use_parent_backface_visibility() const { | 275 bool use_parent_backface_visibility() const { |
| 277 return use_parent_backface_visibility_; | 276 return use_parent_backface_visibility_; |
| 278 } | 277 } |
| 279 | 278 |
| 280 bool ShowDebugBorders() const; | 279 bool ShowDebugBorders() const; |
| 281 | 280 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 return num_dependents_need_push_properties_ > 0; | 523 return num_dependents_need_push_properties_ > 0; |
| 525 } | 524 } |
| 526 | 525 |
| 527 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark); | 526 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark); |
| 528 | 527 |
| 529 virtual void SetDebugInfo( | 528 virtual void SetDebugInfo( |
| 530 scoped_refptr<base::debug::ConvertableToTraceFormat> other); | 529 scoped_refptr<base::debug::ConvertableToTraceFormat> other); |
| 531 | 530 |
| 532 bool IsDrawnRenderSurfaceLayerListMember() const; | 531 bool IsDrawnRenderSurfaceLayerListMember() const; |
| 533 | 532 |
| 533 void Set3dSortingContextId(int id); |
| 534 int sorting_context_id() { return sorting_context_id_; } |
| 535 |
| 534 protected: | 536 protected: |
| 535 LayerImpl(LayerTreeImpl* layer_impl, int id); | 537 LayerImpl(LayerTreeImpl* layer_impl, int id); |
| 536 | 538 |
| 537 // Get the color and size of the layer's debug border. | 539 // Get the color and size of the layer's debug border. |
| 538 virtual void GetDebugBorderProperties(SkColor* color, float* width) const; | 540 virtual void GetDebugBorderProperties(SkColor* color, float* width) const; |
| 539 | 541 |
| 540 void AppendDebugBorderQuad(QuadSink* quad_sink, | 542 void AppendDebugBorderQuad(QuadSink* quad_sink, |
| 541 const SharedQuadState* shared_quad_state, | 543 const SharedQuadState* shared_quad_state, |
| 542 AppendQuadsData* append_quads_data) const; | 544 AppendQuadsData* append_quads_data) const; |
| 543 void AppendDebugBorderQuad(QuadSink* quad_sink, | 545 void AppendDebugBorderQuad(QuadSink* quad_sink, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 bool draw_checkerboard_for_missing_tiles_ : 1; | 613 bool draw_checkerboard_for_missing_tiles_ : 1; |
| 612 bool draws_content_ : 1; | 614 bool draws_content_ : 1; |
| 613 bool hide_layer_and_subtree_ : 1; | 615 bool hide_layer_and_subtree_ : 1; |
| 614 bool force_render_surface_ : 1; | 616 bool force_render_surface_ : 1; |
| 615 | 617 |
| 616 // Cache transform_'s invertibility. | 618 // Cache transform_'s invertibility. |
| 617 bool transform_is_invertible_ : 1; | 619 bool transform_is_invertible_ : 1; |
| 618 | 620 |
| 619 // Set for the layer that other layers are fixed to. | 621 // Set for the layer that other layers are fixed to. |
| 620 bool is_container_for_fixed_position_layers_ : 1; | 622 bool is_container_for_fixed_position_layers_ : 1; |
| 621 bool is_3d_sorted_ : 1; | |
| 622 Region non_fast_scrollable_region_; | 623 Region non_fast_scrollable_region_; |
| 623 Region touch_event_handler_region_; | 624 Region touch_event_handler_region_; |
| 624 SkColor background_color_; | 625 SkColor background_color_; |
| 625 | 626 |
| 626 float opacity_; | 627 float opacity_; |
| 627 SkXfermode::Mode blend_mode_; | 628 SkXfermode::Mode blend_mode_; |
| 628 gfx::PointF position_; | 629 gfx::PointF position_; |
| 629 gfx::Transform transform_; | 630 gfx::Transform transform_; |
| 630 | 631 |
| 631 LayerPositionConstraint position_constraint_; | 632 LayerPositionConstraint position_constraint_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 646 | 647 |
| 647 // This flag is set when the layer needs to push properties to the active | 648 // This flag is set when the layer needs to push properties to the active |
| 648 // side. | 649 // side. |
| 649 bool needs_push_properties_; | 650 bool needs_push_properties_; |
| 650 | 651 |
| 651 // The number of direct children or dependent layers that need to be recursed | 652 // The number of direct children or dependent layers that need to be recursed |
| 652 // to in order for them or a descendent of them to push properties to the | 653 // to in order for them or a descendent of them to push properties to the |
| 653 // active side. | 654 // active side. |
| 654 int num_dependents_need_push_properties_; | 655 int num_dependents_need_push_properties_; |
| 655 | 656 |
| 657 // Layers that share a sorting context id will be sorted together in 3d |
| 658 // space. 0 is a special value that means this layer will not be sorted and |
| 659 // will be drawn in paint order. |
| 660 int sorting_context_id_; |
| 661 |
| 656 DrawMode current_draw_mode_; | 662 DrawMode current_draw_mode_; |
| 657 | 663 |
| 658 private: | 664 private: |
| 659 // Rect indicating what was repainted/updated during update. | 665 // Rect indicating what was repainted/updated during update. |
| 660 // Note that plugin layers bypass this and leave it empty. | 666 // Note that plugin layers bypass this and leave it empty. |
| 661 // Uses layer (not content) space. | 667 // Uses layer (not content) space. |
| 662 gfx::RectF update_rect_; | 668 gfx::RectF update_rect_; |
| 663 | 669 |
| 664 // This rect is in layer space. | 670 // This rect is in layer space. |
| 665 gfx::RectF damage_rect_; | 671 gfx::RectF damage_rect_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 679 DrawProperties<LayerImpl> draw_properties_; | 685 DrawProperties<LayerImpl> draw_properties_; |
| 680 | 686 |
| 681 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 687 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
| 682 | 688 |
| 683 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 689 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 684 }; | 690 }; |
| 685 | 691 |
| 686 } // namespace cc | 692 } // namespace cc |
| 687 | 693 |
| 688 #endif // CC_LAYERS_LAYER_IMPL_H_ | 694 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |