| OLD | NEW |
| 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/TransformPaintPropertyNode.h" | 5 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
| 6 | 6 |
| 7 #include "platform/graphics/paint/PropertyTreeState.h" | 7 #include "platform/graphics/paint/PropertyTreeState.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 // The root of the transform tree. The root transform node references the root |
| 12 // scroll node. |
| 11 TransformPaintPropertyNode* TransformPaintPropertyNode::root() { | 13 TransformPaintPropertyNode* TransformPaintPropertyNode::root() { |
| 12 DEFINE_STATIC_REF(TransformPaintPropertyNode, root, | 14 DEFINE_STATIC_REF(TransformPaintPropertyNode, root, |
| 13 (TransformPaintPropertyNode::create( | 15 adoptRef(new TransformPaintPropertyNode( |
| 14 nullptr, TransformationMatrix(), FloatPoint3D(), | 16 nullptr, TransformationMatrix(), FloatPoint3D(), false, |
| 17 0, CompositingReasonNone, CompositorElementId(), |
| 15 ScrollPaintPropertyNode::root()))); | 18 ScrollPaintPropertyNode::root()))); |
| 16 return root; | 19 return root; |
| 17 } | 20 } |
| 18 | 21 |
| 19 // TODO(pdr): print out scroll node information. | |
| 20 String TransformPaintPropertyNode::toString() const { | 22 String TransformPaintPropertyNode::toString() const { |
| 21 return String::format( | 23 auto transform = String::format( |
| 22 "parent=%p transform=%s origin=%s flattensInheritedTransform=%s " | 24 "parent=%p transform=%s origin=%s flattensInheritedTransform=%s " |
| 23 "renderingContextId=%x directCompositingReasons=%s " | 25 "renderingContextId=%x directCompositingReasons=%s " |
| 24 "compositorElementId=(%d, %d)", | 26 "compositorElementId=(%d, %d)", |
| 25 m_parent.get(), m_matrix.toString().ascii().data(), | 27 m_parent.get(), m_matrix.toString().ascii().data(), |
| 26 m_origin.toString().ascii().data(), | 28 m_origin.toString().ascii().data(), |
| 27 m_flattensInheritedTransform ? "yes" : "no", m_renderingContextId, | 29 m_flattensInheritedTransform ? "yes" : "no", m_renderingContextId, |
| 28 compositingReasonsAsString(m_directCompositingReasons).ascii().data(), | 30 compositingReasonsAsString(m_directCompositingReasons).ascii().data(), |
| 29 m_compositorElementId.primaryId, m_compositorElementId.secondaryId); | 31 m_compositorElementId.primaryId, m_compositorElementId.secondaryId); |
| 32 if (m_scroll) |
| 33 return transform + " scroll=" + m_scroll->toString(); |
| 34 return transform; |
| 30 } | 35 } |
| 31 | 36 |
| 32 #if DCHECK_IS_ON() | 37 #if DCHECK_IS_ON() |
| 33 | 38 |
| 34 String TransformPaintPropertyNode::toTreeString() const { | 39 String TransformPaintPropertyNode::toTreeString() const { |
| 35 return blink::PropertyTreeStatePrinter<blink::TransformPaintPropertyNode>() | 40 return blink::PropertyTreeStatePrinter<blink::TransformPaintPropertyNode>() |
| 36 .pathAsString(this); | 41 .pathAsString(this); |
| 37 } | 42 } |
| 38 | 43 |
| 39 #endif | 44 #endif |
| 40 | 45 |
| 41 } // namespace blink | 46 } // namespace blink |
| OLD | NEW |