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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <memory> | 12 #include <memory> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "cc/animation/element_id.h" |
21 #include "cc/animation/target_property.h" | 22 #include "cc/animation/target_property.h" |
22 #include "cc/base/cc_export.h" | 23 #include "cc/base/cc_export.h" |
23 #include "cc/base/region.h" | 24 #include "cc/base/region.h" |
24 #include "cc/base/synced_property.h" | 25 #include "cc/base/synced_property.h" |
25 #include "cc/input/input_handler.h" | 26 #include "cc/input/input_handler.h" |
26 #include "cc/layers/draw_properties.h" | 27 #include "cc/layers/draw_properties.h" |
27 #include "cc/layers/layer_collections.h" | 28 #include "cc/layers/layer_collections.h" |
28 #include "cc/layers/layer_impl_test_properties.h" | 29 #include "cc/layers/layer_impl_test_properties.h" |
29 #include "cc/layers/layer_position_constraint.h" | 30 #include "cc/layers/layer_position_constraint.h" |
30 #include "cc/layers/performance_properties.h" | 31 #include "cc/layers/performance_properties.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void SetMasksToBounds(bool masks_to_bounds); | 229 void SetMasksToBounds(bool masks_to_bounds); |
229 bool masks_to_bounds() const { return masks_to_bounds_; } | 230 bool masks_to_bounds() const { return masks_to_bounds_; } |
230 | 231 |
231 void SetContentsOpaque(bool opaque); | 232 void SetContentsOpaque(bool opaque); |
232 bool contents_opaque() const { return contents_opaque_; } | 233 bool contents_opaque() const { return contents_opaque_; } |
233 | 234 |
234 float Opacity() const; | 235 float Opacity() const; |
235 bool OpacityIsAnimating() const; | 236 bool OpacityIsAnimating() const; |
236 bool HasPotentiallyRunningOpacityAnimation() const; | 237 bool HasPotentiallyRunningOpacityAnimation() const; |
237 | 238 |
238 void SetElementId(uint64_t element_id); | 239 void SetElementId(ElementId element_id); |
239 uint64_t element_id() const { return element_id_; } | 240 ElementId element_id() const { return element_id_; } |
240 | 241 |
241 void SetMutableProperties(uint32_t properties); | 242 void SetMutableProperties(uint32_t properties); |
242 uint32_t mutable_properties() const { return mutable_properties_; } | 243 uint32_t mutable_properties() const { return mutable_properties_; } |
243 | 244 |
244 void SetBlendMode(SkXfermode::Mode); | 245 void SetBlendMode(SkXfermode::Mode); |
245 SkXfermode::Mode blend_mode() const { return blend_mode_; } | 246 SkXfermode::Mode blend_mode() const { return blend_mode_; } |
246 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { | 247 void set_draw_blend_mode(SkXfermode::Mode blend_mode) { |
247 if (draw_blend_mode_ == blend_mode) | 248 if (draw_blend_mode_ == blend_mode) |
248 return; | 249 return; |
249 draw_blend_mode_ = blend_mode; | 250 draw_blend_mode_ = blend_mode; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 friend class TreeSynchronizer; | 613 friend class TreeSynchronizer; |
613 | 614 |
614 // Layers that share a sorting context id will be sorted together in 3d | 615 // Layers that share a sorting context id will be sorted together in 3d |
615 // space. 0 is a special value that means this layer will not be sorted and | 616 // space. 0 is a special value that means this layer will not be sorted and |
616 // will be drawn in paint order. | 617 // will be drawn in paint order. |
617 int sorting_context_id_; | 618 int sorting_context_id_; |
618 | 619 |
619 DrawMode current_draw_mode_; | 620 DrawMode current_draw_mode_; |
620 | 621 |
621 private: | 622 private: |
622 uint64_t element_id_; | 623 ElementId element_id_; |
623 uint32_t mutable_properties_; | 624 uint32_t mutable_properties_; |
624 // Rect indicating what was repainted/updated during update. | 625 // Rect indicating what was repainted/updated during update. |
625 // Note that plugin layers bypass this and leave it empty. | 626 // Note that plugin layers bypass this and leave it empty. |
626 // This is in the layer's space. | 627 // This is in the layer's space. |
627 gfx::Rect update_rect_; | 628 gfx::Rect update_rect_; |
628 | 629 |
629 // Denotes an area that is damaged and needs redraw. This is in the layer's | 630 // Denotes an area that is damaged and needs redraw. This is in the layer's |
630 // space. | 631 // space. |
631 gfx::Rect damage_rect_; | 632 gfx::Rect damage_rect_; |
632 | 633 |
633 // Group of properties that need to be computed based on the layer tree | 634 // Group of properties that need to be computed based on the layer tree |
634 // hierarchy before layers can be drawn. | 635 // hierarchy before layers can be drawn. |
635 DrawProperties draw_properties_; | 636 DrawProperties draw_properties_; |
636 PerformanceProperties<LayerImpl> performance_properties_; | 637 PerformanceProperties<LayerImpl> performance_properties_; |
637 | 638 |
638 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 639 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
639 owned_debug_info_; | 640 owned_debug_info_; |
640 base::trace_event::ConvertableToTraceFormat* debug_info_; | 641 base::trace_event::ConvertableToTraceFormat* debug_info_; |
641 std::unique_ptr<RenderSurfaceImpl> render_surface_; | 642 std::unique_ptr<RenderSurfaceImpl> render_surface_; |
642 | 643 |
643 bool scrolls_drawn_descendant_; | 644 bool scrolls_drawn_descendant_; |
644 bool has_will_change_transform_hint_; | 645 bool has_will_change_transform_hint_; |
645 | 646 |
646 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 647 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
647 }; | 648 }; |
648 | 649 |
649 } // namespace cc | 650 } // namespace cc |
650 | 651 |
651 #endif // CC_LAYERS_LAYER_IMPL_H_ | 652 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |