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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp

Issue 2837183002: [SPv2] Apply effects before clips for when the effect does not move pixels (Closed)
Patch Set: none Created 3 years, 8 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 | « no previous file | third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/paint/PropertyTreeState.h" 5 #include "platform/graphics/paint/PropertyTreeState.h"
6 6
7 #include "platform/graphics/paint/GeometryMapper.h" 7 #include "platform/graphics/paint/GeometryMapper.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 IsAncestorOf<TransformPaintPropertyNode>(effect_->LocalTransformSpace(), 85 IsAncestorOf<TransformPaintPropertyNode>(effect_->LocalTransformSpace(),
86 transform_.Get()); 86 transform_.Get());
87 87
88 if (!transform_->IsRoot() && clip_transform_strict_ancestor_of_transform && 88 if (!transform_->IsRoot() && clip_transform_strict_ancestor_of_transform &&
89 effect_transform_strict_ancestor_of_transform) 89 effect_transform_strict_ancestor_of_transform)
90 return kTransform; 90 return kTransform;
91 91
92 bool clip_ancestor_of_effect = 92 bool clip_ancestor_of_effect =
93 IsAncestorOf<ClipPaintPropertyNode>(clip_.Get(), effect_->OutputClip()); 93 IsAncestorOf<ClipPaintPropertyNode>(clip_.Get(), effect_->OutputClip());
94 94
95 if (!effect_->IsRoot() && clip_ancestor_of_effect) { 95 if (!effect_->IsRoot() &&
96 (clip_ancestor_of_effect ||
97 // Effects that don't move pixels commute with all clips, so always apply
98 // them first when inside compatible transforms.
99 (!effect_->HasFilterThatMovesPixels() &&
100 !effect_transform_strict_ancestor_of_transform))) {
96 return kEffect; 101 return kEffect;
97 } 102 }
98 if (!clip_->IsRoot()) 103 if (!clip_->IsRoot())
99 return kClip; 104 return kClip;
100 return kNone; 105 return kNone;
101 } 106 }
102 107
103 const PropertyTreeState* PropertyTreeStateIterator::Next() { 108 const PropertyTreeState* PropertyTreeStateIterator::Next() {
104 switch (properties_.GetInnermostNode()) { 109 switch (properties_.GetInnermostNode()) {
105 case PropertyTreeState::kTransform: 110 case PropertyTreeState::kTransform:
(...skipping 14 matching lines...) Expand all
120 #if DCHECK_IS_ON() 125 #if DCHECK_IS_ON()
121 126
122 String PropertyTreeState::ToTreeString() const { 127 String PropertyTreeState::ToTreeString() const {
123 return Transform()->ToTreeString() + "\n" + Clip()->ToTreeString() + "\n" + 128 return Transform()->ToTreeString() + "\n" + Clip()->ToTreeString() + "\n" +
124 Effect()->ToTreeString(); 129 Effect()->ToTreeString();
125 } 130 }
126 131
127 #endif 132 #endif
128 133
129 } // namespace blink 134 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698