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

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

Issue 2495973002: [SPv2] Add filter support in PaintArtifactCompositor (Closed)
Patch Set: Created 4 years, 1 month 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
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/playback/display_item_list.h" 10 #include "cc/playback/display_item_list.h"
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 "be contiguous."; 669 "be contiguous.";
670 m_effectNodesConverted.add(nextEffect); 670 m_effectNodesConverted.add(nextEffect);
671 #endif 671 #endif
672 672
673 // We currently create dummy layers to host effect nodes and corresponding 673 // We currently create dummy layers to host effect nodes and corresponding
674 // render surfaces. This should be removed once cc implements better support 674 // render surfaces. This should be removed once cc implements better support
675 // for freestanding property trees. 675 // for freestanding property trees.
676 scoped_refptr<cc::Layer> dummyLayer = cc::Layer::Create(); 676 scoped_refptr<cc::Layer> dummyLayer = cc::Layer::Create();
677 m_rootLayer->AddChild(dummyLayer); 677 m_rootLayer->AddChild(dummyLayer);
678 678
679 // Also cc assumes a clip node is always created by a layer that creates 679 int outputClipId = compositorIdForClipNode(nextEffect->outputClip());
680 // render surface.
681 cc::ClipNode& dummyClip =
682 *clipTree().Node(clipTree().Insert(cc::ClipNode(), kSecondaryRootNodeId));
683 dummyClip.owner_id = dummyLayer->id();
684 dummyClip.transform_id = kRealRootNodeId;
685 dummyClip.target_transform_id = kRealRootNodeId;
686 dummyClip.target_effect_id = kSecondaryRootNodeId;
687 680
688 cc::EffectNode& effectNode = *effectTree().Node(effectTree().Insert( 681 cc::EffectNode& effectNode = *effectTree().Node(effectTree().Insert(
689 cc::EffectNode(), compositorIdForCurrentEffectNode())); 682 cc::EffectNode(), compositorIdForCurrentEffectNode()));
690 effectNode.owner_id = dummyLayer->id(); 683 effectNode.owner_id = dummyLayer->id();
691 effectNode.clip_id = dummyClip.id; 684 effectNode.clip_id = outputClipId;
685 effectNode.has_render_surface = true;
692 effectNode.opacity = nextEffect->opacity(); 686 effectNode.opacity = nextEffect->opacity();
687 effectNode.filters = nextEffect->filter().asCcFilterOperations();
693 m_effectStack.append(BlinkEffectAndCcIdPair{nextEffect, effectNode.id}); 688 m_effectStack.append(BlinkEffectAndCcIdPair{nextEffect, effectNode.id});
694 689
695 dummyLayer->set_property_tree_sequence_number(kPropertyTreeSequenceNumber); 690 dummyLayer->set_property_tree_sequence_number(kPropertyTreeSequenceNumber);
696 dummyLayer->SetTransformTreeIndex(kSecondaryRootNodeId); 691 dummyLayer->SetTransformTreeIndex(kSecondaryRootNodeId);
697 dummyLayer->SetClipTreeIndex(dummyClip.id); 692 dummyLayer->SetClipTreeIndex(outputClipId);
698 dummyLayer->SetEffectTreeIndex(effectNode.id); 693 dummyLayer->SetEffectTreeIndex(effectNode.id);
699 dummyLayer->SetScrollTreeIndex(kRealRootNodeId); 694 dummyLayer->SetScrollTreeIndex(kRealRootNodeId);
700 } 695 }
701 696
702 } // namespace 697 } // namespace
703 698
704 void PaintArtifactCompositor::update( 699 void PaintArtifactCompositor::update(
705 const PaintArtifact& paintArtifact, 700 const PaintArtifact& paintArtifact,
706 RasterInvalidationTrackingMap<const PaintChunk>* rasterChunkInvalidations) { 701 RasterInvalidationTrackingMap<const PaintChunk>* rasterChunkInvalidations) {
707 DCHECK(m_rootLayer); 702 DCHECK(m_rootLayer);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 m_contentLayerClients.clear(); 768 m_contentLayerClients.clear();
774 m_contentLayerClients.swap(newContentLayerClients); 769 m_contentLayerClients.swap(newContentLayerClients);
775 770
776 // Mark the property trees as having been rebuilt. 771 // Mark the property trees as having been rebuilt.
777 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; 772 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber;
778 layerTree->property_trees()->needs_rebuild = false; 773 layerTree->property_trees()->needs_rebuild = false;
779 layerTree->property_trees()->ResetCachedData(); 774 layerTree->property_trees()->ResetCachedData();
780 } 775 }
781 776
782 } // namespace blink 777 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698