Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/graphics/compositing/PaintArtifactCompositor.h" | 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
| 6 | 6 |
| 7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
| 10 #include "cc/paint/display_item_list.h" | 10 #include "cc/paint/display_item_list.h" |
| 11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
| 12 #include "cc/trees/mutator_host_client.h" | |
| 12 #include "platform/RuntimeEnabledFeatures.h" | 13 #include "platform/RuntimeEnabledFeatures.h" |
| 13 #include "platform/graphics/GraphicsContext.h" | 14 #include "platform/graphics/GraphicsContext.h" |
| 14 #include "platform/graphics/compositing/PaintChunksToCcLayer.h" | 15 #include "platform/graphics/compositing/PaintChunksToCcLayer.h" |
| 15 #include "platform/graphics/compositing/PropertyTreeManager.h" | 16 #include "platform/graphics/compositing/PropertyTreeManager.h" |
| 16 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 17 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
| 17 #include "platform/graphics/paint/DisplayItem.h" | 18 #include "platform/graphics/paint/DisplayItem.h" |
| 18 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" | 19 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" |
| 19 #include "platform/graphics/paint/GeometryMapper.h" | 20 #include "platform/graphics/paint/GeometryMapper.h" |
| 20 #include "platform/graphics/paint/PaintArtifact.h" | 21 #include "platform/graphics/paint/PaintArtifact.h" |
| 21 #include "platform/graphics/paint/PropertyTreeState.h" | 22 #include "platform/graphics/paint/PropertyTreeState.h" |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 layer->set_offset_to_transform_parent(layer_offset); | 650 layer->set_offset_to_transform_parent(layer_offset); |
| 650 CompositorElementId element_id = | 651 CompositorElementId element_id = |
| 651 pending_layer.property_tree_state.GetCompositorElementId( | 652 pending_layer.property_tree_state.GetCompositorElementId( |
| 652 composited_element_ids); | 653 composited_element_ids); |
| 653 if (element_id) { | 654 if (element_id) { |
| 654 layer->SetElementId(element_id); | 655 layer->SetElementId(element_id); |
| 655 composited_element_ids.insert(element_id); | 656 composited_element_ids.insert(element_id); |
| 656 } | 657 } |
| 657 | 658 |
| 658 root_layer_->AddChild(layer); | 659 root_layer_->AddChild(layer); |
| 660 auto previous_host = layer->layer_tree_host(); | |
|
pdr.
2017/05/16 02:46:35
What does it mean to change layer tree hosts? In m
wkorman
2017/05/16 21:42:42
It appears that the LayerTreeHost of a layer is up
| |
| 661 if (previous_host) { | |
| 662 previous_host->UnregisterElement(element_id, cc::ElementListType::ACTIVE, | |
| 663 layer.get()); | |
| 664 } | |
| 665 auto host = root_layer_->layer_tree_host(); | |
| 666 if (element_id) { | |
| 667 host->RegisterElement(element_id, cc::ElementListType::ACTIVE, | |
| 668 layer.get()); | |
| 669 if (host->mutator_host()->HasAnyAnimation(element_id)) | |
|
pdr.
2017/05/16 02:46:35
Do we set animations on the animation host yet?
wkorman
2017/05/16 21:42:42
If I understand your question correctly, given tha
| |
| 670 host->SetNeedsCommit(); | |
| 671 } | |
| 672 | |
| 659 layer->set_property_tree_sequence_number(g_s_property_tree_sequence_number); | 673 layer->set_property_tree_sequence_number(g_s_property_tree_sequence_number); |
| 660 layer->SetTransformTreeIndex(transform_id); | 674 layer->SetTransformTreeIndex(transform_id); |
| 661 layer->SetClipTreeIndex(clip_id); | 675 layer->SetClipTreeIndex(clip_id); |
| 662 layer->SetEffectTreeIndex(effect_id); | 676 layer->SetEffectTreeIndex(effect_id); |
| 663 property_tree_manager.UpdateLayerScrollMapping(layer.get(), transform); | 677 property_tree_manager.UpdateLayerScrollMapping(layer.get(), transform); |
| 664 | 678 |
| 665 layer->SetShouldCheckBackfaceVisibility(pending_layer.backface_hidden); | 679 layer->SetShouldCheckBackfaceVisibility(pending_layer.backface_hidden); |
| 666 | 680 |
| 667 if (extra_data_for_testing_enabled_) | 681 if (extra_data_for_testing_enabled_) |
| 668 extra_data_for_testing_->content_layers.push_back(layer); | 682 extra_data_for_testing_->content_layers.push_back(layer); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 682 #ifndef NDEBUG | 696 #ifndef NDEBUG |
| 683 void PaintArtifactCompositor::ShowDebugData() { | 697 void PaintArtifactCompositor::ShowDebugData() { |
| 684 LOG(ERROR) << LayersAsJSON(kLayerTreeIncludesDebugInfo) | 698 LOG(ERROR) << LayersAsJSON(kLayerTreeIncludesDebugInfo) |
| 685 ->ToPrettyJSONString() | 699 ->ToPrettyJSONString() |
| 686 .Utf8() | 700 .Utf8() |
| 687 .data(); | 701 .data(); |
| 688 } | 702 } |
| 689 #endif | 703 #endif |
| 690 | 704 |
| 691 } // namespace blink | 705 } // namespace blink |
| OLD | NEW |