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

Side by Side Diff: cc/trees/layer_tree_impl.h

Issue 1447893002: compositor-worker: Introduce WebCompositorMutableState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_TREES_LAYER_TREE_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_
6 #define CC_TREES_LAYER_TREE_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_IMPL_H_
7 7
8 #include <map>
9 #include <set> 8 #include <set>
10 #include <string> 9 #include <string>
11 #include <vector> 10 #include <vector>
12 11
13 #include "base/containers/hash_tables.h" 12 #include "base/containers/hash_tables.h"
14 #include "base/values.h" 13 #include "base/values.h"
15 #include "cc/base/synced_property.h" 14 #include "cc/base/synced_property.h"
16 #include "cc/input/layer_selection_bound.h" 15 #include "cc/input/layer_selection_bound.h"
17 #include "cc/layers/layer_impl.h" 16 #include "cc/layers/layer_impl.h"
18 #include "cc/output/begin_frame_args.h" 17 #include "cc/output/begin_frame_args.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void SetPropertyTrees(const PropertyTrees& property_trees) { 127 void SetPropertyTrees(const PropertyTrees& property_trees) {
129 property_trees_ = property_trees; 128 property_trees_ = property_trees;
130 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); 129 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false);
131 } 130 }
132 PropertyTrees* property_trees() { return &property_trees_; } 131 PropertyTrees* property_trees() { return &property_trees_; }
133 132
134 void UpdatePropertyTreesForBoundsDelta(); 133 void UpdatePropertyTreesForBoundsDelta();
135 134
136 void PushPropertiesTo(LayerTreeImpl* tree_impl); 135 void PushPropertiesTo(LayerTreeImpl* tree_impl);
137 136
137 struct CC_EXPORT ElementLayers {
138 // Transform and opacity mutations apply to this layer.
139 LayerImpl* main = nullptr;
140 // Scroll mutations apply to this layer.
141 LayerImpl* scroll = nullptr;
142 };
143
144 void AddToElementMap(LayerImpl* layer);
145 void RemoveFromElementMap(LayerImpl* layer);
146 ElementLayers GetMutableLayers(uint64_t element_id);
138 int source_frame_number() const { return source_frame_number_; } 147 int source_frame_number() const { return source_frame_number_; }
139 void set_source_frame_number(int frame_number) { 148 void set_source_frame_number(int frame_number) {
140 source_frame_number_ = frame_number; 149 source_frame_number_ = frame_number;
141 } 150 }
142 151
143 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } 152 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; }
144 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { 153 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) {
145 hud_layer_ = layer_impl; 154 hud_layer_ = layer_impl;
146 } 155 }
147 156
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 float max_page_scale_factor_; 460 float max_page_scale_factor_;
452 461
453 float device_scale_factor_; 462 float device_scale_factor_;
454 float painted_device_scale_factor_; 463 float painted_device_scale_factor_;
455 464
456 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; 465 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_;
457 466
458 typedef base::hash_map<int, LayerImpl*> LayerIdMap; 467 typedef base::hash_map<int, LayerImpl*> LayerIdMap;
459 LayerIdMap layer_id_map_; 468 LayerIdMap layer_id_map_;
460 469
470 base::hash_map<uint64_t, ElementLayers> element_layers_map_;
471
461 // Maps from clip layer ids to scroll layer ids. Note that this only includes 472 // Maps from clip layer ids to scroll layer ids. Note that this only includes
462 // the subset of clip layers that act as scrolling containers. (This is 473 // the subset of clip layers that act as scrolling containers. (This is
463 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) 474 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.)
464 base::hash_map<int, int> clip_scroll_map_; 475 base::hash_map<int, int> clip_scroll_map_;
465 476
466 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there 477 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there
467 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is 478 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is
468 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid 479 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid
469 // O(n) walks.) 480 // O(n) walks.)
470 std::multimap<int, int> scrollbar_map_; 481 std::multimap<int, int> scrollbar_map_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 520
510 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; 521 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
511 522
512 private: 523 private:
513 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 524 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
514 }; 525 };
515 526
516 } // namespace cc 527 } // namespace cc
517 528
518 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 529 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698