| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 paintArtifact.paintChunks().begin(); | 589 paintArtifact.paintChunks().begin(); |
| 590 layerizeGroup(paintArtifact, pendingLayers, geometryMapper, | 590 layerizeGroup(paintArtifact, pendingLayers, geometryMapper, |
| 591 *EffectPaintPropertyNode::root(), cursor); | 591 *EffectPaintPropertyNode::root(), cursor); |
| 592 DCHECK_EQ(paintArtifact.paintChunks().end(), cursor); | 592 DCHECK_EQ(paintArtifact.paintChunks().end(), cursor); |
| 593 } | 593 } |
| 594 | 594 |
| 595 void PaintArtifactCompositor::update( | 595 void PaintArtifactCompositor::update( |
| 596 const PaintArtifact& paintArtifact, | 596 const PaintArtifact& paintArtifact, |
| 597 RasterInvalidationTrackingMap<const PaintChunk>* rasterChunkInvalidations, | 597 RasterInvalidationTrackingMap<const PaintChunk>* rasterChunkInvalidations, |
| 598 bool storeDebugInfo, | 598 bool storeDebugInfo, |
| 599 GeometryMapper& geometryMapper) { | 599 GeometryMapper& geometryMapper, |
| 600 CompositorElementIdSet& compositedElementIds) { |
| 600 #ifndef NDEBUG | 601 #ifndef NDEBUG |
| 601 storeDebugInfo = true; | 602 storeDebugInfo = true; |
| 602 #endif | 603 #endif |
| 603 | 604 |
| 604 DCHECK(m_rootLayer); | 605 DCHECK(m_rootLayer); |
| 605 | 606 |
| 606 cc::LayerTreeHost* layerTreeHost = m_rootLayer->layer_tree_host(); | 607 cc::LayerTreeHost* layerTreeHost = m_rootLayer->layer_tree_host(); |
| 607 | 608 |
| 608 // The tree will be null after detaching and this update can be ignored. | 609 // The tree will be null after detaching and this update can be ignored. |
| 609 // See: WebViewImpl::detachPaintArtifactCompositor(). | 610 // See: WebViewImpl::detachPaintArtifactCompositor(). |
| (...skipping 24 matching lines...) Expand all Loading... |
| 634 | 635 |
| 635 const auto* transform = pendingLayer.propertyTreeState.transform(); | 636 const auto* transform = pendingLayer.propertyTreeState.transform(); |
| 636 int transformId = | 637 int transformId = |
| 637 propertyTreeManager.ensureCompositorTransformNode(transform); | 638 propertyTreeManager.ensureCompositorTransformNode(transform); |
| 638 int clipId = propertyTreeManager.ensureCompositorClipNode( | 639 int clipId = propertyTreeManager.ensureCompositorClipNode( |
| 639 pendingLayer.propertyTreeState.clip()); | 640 pendingLayer.propertyTreeState.clip()); |
| 640 int effectId = propertyTreeManager.switchToEffectNode( | 641 int effectId = propertyTreeManager.switchToEffectNode( |
| 641 *pendingLayer.propertyTreeState.effect()); | 642 *pendingLayer.propertyTreeState.effect()); |
| 642 | 643 |
| 643 layer->set_offset_to_transform_parent(layerOffset); | 644 layer->set_offset_to_transform_parent(layerOffset); |
| 644 layer->SetElementId(pendingLayer.propertyTreeState.compositorElementId()); | 645 CompositorElementId elementId = |
| 646 pendingLayer.propertyTreeState.compositorElementId(); |
| 647 if (elementId) { |
| 648 layer->SetElementId(elementId); |
| 649 compositedElementIds.insert(elementId); |
| 650 } |
| 645 | 651 |
| 646 m_rootLayer->AddChild(layer); | 652 m_rootLayer->AddChild(layer); |
| 647 layer->set_property_tree_sequence_number(sPropertyTreeSequenceNumber); | 653 layer->set_property_tree_sequence_number(sPropertyTreeSequenceNumber); |
| 648 layer->SetTransformTreeIndex(transformId); | 654 layer->SetTransformTreeIndex(transformId); |
| 649 layer->SetClipTreeIndex(clipId); | 655 layer->SetClipTreeIndex(clipId); |
| 650 layer->SetEffectTreeIndex(effectId); | 656 layer->SetEffectTreeIndex(effectId); |
| 651 propertyTreeManager.updateLayerScrollMapping(layer.get(), transform); | 657 propertyTreeManager.updateLayerScrollMapping(layer.get(), transform); |
| 652 | 658 |
| 653 layer->SetShouldCheckBackfaceVisibility(pendingLayer.backfaceHidden); | 659 layer->SetShouldCheckBackfaceVisibility(pendingLayer.backfaceHidden); |
| 654 | 660 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 670 #ifndef NDEBUG | 676 #ifndef NDEBUG |
| 671 void PaintArtifactCompositor::showDebugData() { | 677 void PaintArtifactCompositor::showDebugData() { |
| 672 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) | 678 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) |
| 673 ->toPrettyJSONString() | 679 ->toPrettyJSONString() |
| 674 .utf8() | 680 .utf8() |
| 675 .data(); | 681 .data(); |
| 676 } | 682 } |
| 677 #endif | 683 #endif |
| 678 | 684 |
| 679 } // namespace blink | 685 } // namespace blink |
| OLD | NEW |