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

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: Address review feedback. Created 4 years, 11 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
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 void SetPropertyTrees(const PropertyTrees& property_trees) { 131 void SetPropertyTrees(const PropertyTrees& property_trees) {
135 property_trees_ = property_trees; 132 property_trees_ = property_trees;
136 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false); 133 property_trees_.transform_tree.set_source_to_parent_updates_allowed(false);
137 } 134 }
138 PropertyTrees* property_trees() { return &property_trees_; } 135 PropertyTrees* property_trees() { return &property_trees_; }
139 136
140 void UpdatePropertyTreesForBoundsDelta(); 137 void UpdatePropertyTreesForBoundsDelta();
141 138
142 void PushPropertiesTo(LayerTreeImpl* tree_impl); 139 void PushPropertiesTo(LayerTreeImpl* tree_impl);
143 140
141 struct CC_EXPORT ElementLayers {
142 // Transform and opacity mutations apply to this layer.
143 LayerImpl* main = nullptr;
144 // Scroll mutations apply to this layer.
145 LayerImpl* scroll = nullptr;
146 };
147
148 void AddToElementMap(LayerImpl* layer);
149 void RemoveFromElementMap(LayerImpl* layer);
150 ElementLayers GetMutableLayers(uint64_t element_id);
144 int source_frame_number() const { return source_frame_number_; } 151 int source_frame_number() const { return source_frame_number_; }
145 void set_source_frame_number(int frame_number) { 152 void set_source_frame_number(int frame_number) {
146 source_frame_number_ = frame_number; 153 source_frame_number_ = frame_number;
147 } 154 }
148 155
149 bool is_first_frame_after_commit() const { 156 bool is_first_frame_after_commit() const {
150 return source_frame_number_ != is_first_frame_after_commit_tracker_; 157 return source_frame_number_ != is_first_frame_after_commit_tracker_;
151 } 158 }
152 159
153 void set_is_first_frame_after_commit(bool is_first_frame_after_commit) { 160 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
469 float max_page_scale_factor_; 476 float max_page_scale_factor_;
470 477
471 float device_scale_factor_; 478 float device_scale_factor_;
472 float painted_device_scale_factor_; 479 float painted_device_scale_factor_;
473 480
474 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_; 481 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_;
475 482
476 typedef base::hash_map<int, LayerImpl*> LayerIdMap; 483 typedef base::hash_map<int, LayerImpl*> LayerIdMap;
477 LayerIdMap layer_id_map_; 484 LayerIdMap layer_id_map_;
478 485
486 base::hash_map<uint64_t, ElementLayers> element_layers_map_;
487
479 // Maps from clip layer ids to scroll layer ids. Note that this only includes 488 // Maps from clip layer ids to scroll layer ids. Note that this only includes
480 // the subset of clip layers that act as scrolling containers. (This is 489 // the subset of clip layers that act as scrolling containers. (This is
481 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) 490 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.)
482 base::hash_map<int, int> clip_scroll_map_; 491 base::hash_map<int, int> clip_scroll_map_;
483 492
484 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there 493 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there
485 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is 494 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is
486 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid 495 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid
487 // O(n) walks.) 496 // O(n) walks.)
488 std::multimap<int, int> scrollbar_map_; 497 std::multimap<int, int> scrollbar_map_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 536
528 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; 537 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
529 538
530 private: 539 private:
531 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 540 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
532 }; 541 };
533 542
534 } // namespace cc 543 } // namespace cc
535 544
536 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 545 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698