OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |