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

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

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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/trees/layer_tree_impl.h ('k') | cc/trees/property_tree_builder.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 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 #include "cc/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 void LayerTreeImpl::AddToElementMap(LayerImpl* layer) { 372 void LayerTreeImpl::AddToElementMap(LayerImpl* layer) {
373 if (!layer->element_id()) 373 if (!layer->element_id())
374 return; 374 return;
375 375
376 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), 376 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
377 "LayerTreeImpl::AddToElementMap", "element_id", 377 "LayerTreeImpl::AddToElementMap", "element_id",
378 layer->element_id(), "layer_id", layer->id()); 378 layer->element_id(), "layer_id", layer->id());
379 379
380 ElementLayers& layers = element_layers_map_[layer->element_id()]; 380 ElementLayers& layers = element_layers_map_[layer->element_id()];
381 if (layer->mutable_properties() & kMainLayerFlags) { 381 if (layer->mutable_properties() & kMainLayerFlags) {
382 if (!layers.main || layer->IsActive()) 382 layers.main = layer;
383 layers.main = layer;
384 } 383 }
385 if (layer->mutable_properties() & kScrollLayerFlags) { 384 if (layer->mutable_properties() & kScrollLayerFlags) {
386 if (!layers.scroll || layer->IsActive()) { 385 TRACE_EVENT2("compositor-worker", "LayerTreeImpl::AddToElementMap scroll",
387 TRACE_EVENT2("compositor-worker", "LayerTreeImpl::AddToElementMap scroll", 386 "element_id", layer->element_id(), "layer_id", layer->id());
388 "element_id", layer->element_id(), "layer_id", layer->id()); 387 layers.scroll = layer;
389 layers.scroll = layer;
390 }
391 } 388 }
392 } 389 }
393 390
394 void LayerTreeImpl::RemoveFromElementMap(LayerImpl* layer) { 391 void LayerTreeImpl::RemoveFromElementMap(LayerImpl* layer) {
395 if (!layer->element_id()) 392 if (!layer->element_id())
396 return; 393 return;
397 394
398 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), 395 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
399 "LayerTreeImpl::RemoveFromElementMap", "element_id", 396 "LayerTreeImpl::RemoveFromElementMap", "element_id",
400 layer->element_id(), "layer_id", layer->id()); 397 layer->element_id(), "layer_id", layer->id());
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 const gfx::BoxF& box, 2072 const gfx::BoxF& box,
2076 gfx::BoxF* bounds) const { 2073 gfx::BoxF* bounds) const {
2077 *bounds = gfx::BoxF(); 2074 *bounds = gfx::BoxF();
2078 return layer_tree_host_impl_->animation_host() 2075 return layer_tree_host_impl_->animation_host()
2079 ? layer_tree_host_impl_->animation_host() 2076 ? layer_tree_host_impl_->animation_host()
2080 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 2077 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
2081 : true; 2078 : true;
2082 } 2079 }
2083 2080
2084 } // namespace cc 2081 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698