Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "platform/graphics/paint/PropertyTreeState.h" | |
| 6 | |
| 7 namespace blink { | |
| 8 | |
| 9 bool PropertyTreeState::hasDirectCompositingReasons() const { | |
|
trchen
2016/12/20 23:49:36
This feels a weird place to me. IMO the concept of
chrishtr
2016/12/20 23:58:10
doesn't apply to chunks.
I don't have it on chunk
trchen
2016/12/21 00:37:11
Ah, I see. It all makes sense now. However I feel
| |
| 10 switch (innermostNode()) { | |
| 11 case Transform: | |
| 12 return transform()->hasDirectCompositingReasons(); | |
| 13 case Clip: | |
| 14 return clip()->hasDirectCompositingReasons(); | |
| 15 case Effect: | |
| 16 return effect()->hasDirectCompositingReasons(); | |
| 17 default: | |
| 18 return false; | |
| 19 } | |
| 20 } | |
| 21 | |
| 22 PropertyTreeState::InnermostNode PropertyTreeState::innermostNode() const { | |
|
trchen
2016/12/20 23:49:36
Likewise, an imaginary combined tree of mixed type
chrishtr
2016/12/20 23:58:10
See above. I've added it on PropertyTreeState for
| |
| 23 if (!m_transform->isRoot() && m_clip->localTransformSpace() != m_transform && | |
| 24 m_effect->localTransformSpace() != m_transform) | |
|
trchen
2016/12/20 23:49:36
FYI there is one corner case where the transform s
chrishtr
2016/12/20 23:58:10
In this case, the position: fixed chunk would poin
trchen
2016/12/21 00:37:11
It seemed to me you want to guarantee that if stat
| |
| 25 return Transform; | |
| 26 if (!m_effect->isRoot() && m_effect->outputClip() == m_clip) { | |
| 27 return Effect; | |
| 28 } | |
| 29 if (!m_clip->isRoot()) | |
| 30 return Clip; | |
| 31 return None; | |
| 32 } | |
| 33 | |
| 34 const PropertyTreeState* PropertyTreeStateIterator::next() { | |
| 35 switch (m_properties.innermostNode()) { | |
| 36 case PropertyTreeState::Transform: | |
| 37 m_properties.setTransform(m_properties.transform()->parent()); | |
| 38 return &m_properties; | |
| 39 case PropertyTreeState::Clip: | |
| 40 m_properties.setClip(m_properties.clip()->parent()); | |
| 41 return &m_properties; | |
| 42 case PropertyTreeState::Effect: | |
| 43 m_properties.setEffect(m_properties.effect()->parent()); | |
| 44 return &m_properties; | |
| 45 case PropertyTreeState::None: | |
| 46 return nullptr; | |
| 47 } | |
| 48 } | |
| 49 | |
| 50 } // namespace blink | |
| OLD | NEW |