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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2888483002: Manage registering composited elements in PaintArtifactCompositor. (Closed)
Patch Set: Fix inverted logic. Created 3 years, 7 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.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 if (auto previous_host = layer->layer_tree_host()) {
661 previous_host->UnregisterElement(element_id, cc::ElementListType::ACTIVE,
662 layer.get());
663 }
664 if (element_id) {
665 auto host = root_layer_->layer_tree_host();
666 host->RegisterElement(element_id, cc::ElementListType::ACTIVE,
667 layer.get());
668 if (host->mutator_host()->HasAnyAnimation(element_id))
wkorman 2017/05/17 20:07:50 Believe we actually don't need to do this in SPv2,
669 host->SetNeedsCommit();
670 }
671
659 layer->set_property_tree_sequence_number(g_s_property_tree_sequence_number); 672 layer->set_property_tree_sequence_number(g_s_property_tree_sequence_number);
660 layer->SetTransformTreeIndex(transform_id); 673 layer->SetTransformTreeIndex(transform_id);
661 layer->SetClipTreeIndex(clip_id); 674 layer->SetClipTreeIndex(clip_id);
662 layer->SetEffectTreeIndex(effect_id); 675 layer->SetEffectTreeIndex(effect_id);
663 property_tree_manager.UpdateLayerScrollMapping(layer.get(), transform); 676 property_tree_manager.UpdateLayerScrollMapping(layer.get(), transform);
664 677
665 layer->SetShouldCheckBackfaceVisibility(pending_layer.backface_hidden); 678 layer->SetShouldCheckBackfaceVisibility(pending_layer.backface_hidden);
666 679
667 if (extra_data_for_testing_enabled_) 680 if (extra_data_for_testing_enabled_)
668 extra_data_for_testing_->content_layers.push_back(layer); 681 extra_data_for_testing_->content_layers.push_back(layer);
(...skipping 13 matching lines...) Expand all
682 #ifndef NDEBUG 695 #ifndef NDEBUG
683 void PaintArtifactCompositor::ShowDebugData() { 696 void PaintArtifactCompositor::ShowDebugData() {
684 LOG(ERROR) << LayersAsJSON(kLayerTreeIncludesDebugInfo) 697 LOG(ERROR) << LayersAsJSON(kLayerTreeIncludesDebugInfo)
685 ->ToPrettyJSONString() 698 ->ToPrettyJSONString()
686 .Utf8() 699 .Utf8()
687 .data(); 700 .data();
688 } 701 }
689 #endif 702 #endif
690 703
691 } // namespace blink 704 } // namespace blink
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698