Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: cc/layers/layer_impl.h

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get element id's from scroll node data directly. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 friend class TreeSynchronizer; 612 friend class TreeSynchronizer;
612 613
613 // Layers that share a sorting context id will be sorted together in 3d 614 // Layers that share a sorting context id will be sorted together in 3d
614 // space. 0 is a special value that means this layer will not be sorted and 615 // space. 0 is a special value that means this layer will not be sorted and
615 // will be drawn in paint order. 616 // will be drawn in paint order.
616 int sorting_context_id_; 617 int sorting_context_id_;
617 618
618 DrawMode current_draw_mode_; 619 DrawMode current_draw_mode_;
619 620
620 private: 621 private:
621 uint64_t element_id_; 622 ElementId element_id_;
622 uint32_t mutable_properties_; 623 uint32_t mutable_properties_;
623 // Rect indicating what was repainted/updated during update. 624 // Rect indicating what was repainted/updated during update.
624 // Note that plugin layers bypass this and leave it empty. 625 // Note that plugin layers bypass this and leave it empty.
625 // This is in the layer's space. 626 // This is in the layer's space.
626 gfx::Rect update_rect_; 627 gfx::Rect update_rect_;
627 628
628 // Denotes an area that is damaged and needs redraw. This is in the layer's 629 // Denotes an area that is damaged and needs redraw. This is in the layer's
629 // space. 630 // space.
630 gfx::Rect damage_rect_; 631 gfx::Rect damage_rect_;
631 632
632 // Group of properties that need to be computed based on the layer tree 633 // Group of properties that need to be computed based on the layer tree
633 // hierarchy before layers can be drawn. 634 // hierarchy before layers can be drawn.
634 DrawProperties draw_properties_; 635 DrawProperties draw_properties_;
635 PerformanceProperties<LayerImpl> performance_properties_; 636 PerformanceProperties<LayerImpl> performance_properties_;
636 637
637 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> 638 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
638 owned_debug_info_; 639 owned_debug_info_;
639 base::trace_event::ConvertableToTraceFormat* debug_info_; 640 base::trace_event::ConvertableToTraceFormat* debug_info_;
640 std::unique_ptr<RenderSurfaceImpl> render_surface_; 641 std::unique_ptr<RenderSurfaceImpl> render_surface_;
641 642
642 bool scrolls_drawn_descendant_; 643 bool scrolls_drawn_descendant_;
643 bool has_will_change_transform_hint_; 644 bool has_will_change_transform_hint_;
644 645
645 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 646 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
646 }; 647 };
647 648
648 } // namespace cc 649 } // namespace cc
649 650
650 #endif // CC_LAYERS_LAYER_IMPL_H_ 651 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698