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

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: review response. 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 <stddef.h>
9 #include <stdint.h>
10
11 #include <map> 8 #include <map>
12 #include <set> 9 #include <set>
13 #include <string> 10 #include <string>
14 #include <vector> 11 #include <vector>
15 12
16 #include "base/containers/hash_tables.h" 13 #include "base/containers/hash_tables.h"
17 #include "base/macros.h" 14 #include "base/macros.h"
18 #include "base/values.h" 15 #include "base/values.h"
19 #include "cc/base/synced_property.h" 16 #include "cc/base/synced_property.h"
20 #include "cc/input/layer_selection_bound.h" 17 #include "cc/input/layer_selection_bound.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void SetPropertyTrees(const PropertyTrees& property_trees) { 132 void SetPropertyTrees(const PropertyTrees& property_trees) {
136 property_trees_ = property_trees; 133 property_trees_ = property_trees;
137 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); 134 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false);
138 } 135 }
139 PropertyTrees* property_trees() { return &property_trees_; } 136 PropertyTrees* property_trees() { return &property_trees_; }
140 137
141 void UpdatePropertyTreesForBoundsDelta(); 138 void UpdatePropertyTreesForBoundsDelta();
142 139
143 void PushPropertiesTo(LayerTreeImpl* tree_impl); 140 void PushPropertiesTo(LayerTreeImpl* tree_impl);
144 141
142 struct CC_EXPORT ElementLayers {
143 // Transform and opacity mutations apply to this layer.
144 LayerImpl* main = nullptr;
145 // Scroll mutations apply to this layer.
146 LayerImpl* scroll = nullptr;
147 };
148
149 void AddToElementMap(LayerImpl* layer);
150 void RemoveFromElementMap(LayerImpl* layer);
151 ElementLayers GetMutableLayers(uint64_t element_id);
145 int source_frame_number() const { return source_frame_number_; } 152 int source_frame_number() const { return source_frame_number_; }
146 void set_source_frame_number(int frame_number) { 153 void set_source_frame_number(int frame_number) {
147 source_frame_number_ = frame_number; 154 source_frame_number_ = frame_number;
148 } 155 }
149 156
150 bool is_first_frame_after_commit() const { 157 bool is_first_frame_after_commit() const {
151 return source_frame_number_ != is_first_frame_after_commit_tracker_; 158 return source_frame_number_ != is_first_frame_after_commit_tracker_;
152 } 159 }
153 160
154 void set_is_first_frame_after_commit(bool is_first_frame_after_commit) { 161 void set_is_first_frame_after_commit(bool is_first_frame_after_commit) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 float max_page_scale_factor_; 477 float max_page_scale_factor_;
471 478
472 float device_scale_factor_; 479 float device_scale_factor_;
473 float painted_device_scale_factor_; 480 float painted_device_scale_factor_;
474 481
475 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; 482 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_;
476 483
477 typedef base::hash_map<int, LayerImpl*> LayerIdMap; 484 typedef base::hash_map<int, LayerImpl*> LayerIdMap;
478 LayerIdMap layer_id_map_; 485 LayerIdMap layer_id_map_;
479 486
487 base::hash_map<uint64_t, ElementLayers> element_layers_map_;
488
480 // Maps from clip layer ids to scroll layer ids. Note that this only includes 489 // Maps from clip layer ids to scroll layer ids. Note that this only includes
481 // the subset of clip layers that act as scrolling containers. (This is 490 // the subset of clip layers that act as scrolling containers. (This is
482 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) 491 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.)
483 base::hash_map<int, int> clip_scroll_map_; 492 base::hash_map<int, int> clip_scroll_map_;
484 493
485 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there 494 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there
486 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is 495 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is
487 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid 496 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid
488 // O(n) walks.) 497 // O(n) walks.)
489 std::multimap<int, int> scrollbar_map_; 498 std::multimap<int, int> scrollbar_map_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 537
529 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; 538 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
530 539
531 private: 540 private:
532 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 541 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
533 }; 542 };
534 543
535 } // namespace cc 544 } // namespace cc
536 545
537 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 546 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698