| 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/ScrollPaintPropertyNode.h" | 5 #include "platform/graphics/paint/ScrollPaintPropertyNode.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 ScrollPaintPropertyNode* ScrollPaintPropertyNode::root() { | 11 ScrollPaintPropertyNode* ScrollPaintPropertyNode::root() { |
| 12 DEFINE_STATIC_REF(ScrollPaintPropertyNode, root, | 12 DEFINE_STATIC_REF( |
| 13 (ScrollPaintPropertyNode::create( | 13 ScrollPaintPropertyNode, root, |
| 14 nullptr, IntSize(), IntSize(), false, false, 0))); | 14 (ScrollPaintPropertyNode::create(nullptr, IntSize(), IntSize(), false, |
| 15 false, 0, nullptr))); |
| 15 return root; | 16 return root; |
| 16 } | 17 } |
| 17 | 18 |
| 18 String ScrollPaintPropertyNode::toString() const { | 19 String ScrollPaintPropertyNode::toString() const { |
| 19 StringBuilder text; | 20 StringBuilder text; |
| 20 text.append("parent="); | 21 text.append("parent="); |
| 21 text.append(String::format("%p", m_parent.get())); | 22 text.append(String::format("%p", m_parent.get())); |
| 22 text.append(" clip="); | 23 text.append(" clip="); |
| 23 text.append(m_clip.toString()); | 24 text.append(m_clip.toString()); |
| 24 text.append(" bounds="); | 25 text.append(" bounds="); |
| 25 text.append(m_bounds.toString()); | 26 text.append(m_bounds.toString()); |
| 26 | 27 |
| 27 text.append(" userScrollable="); | 28 text.append(" userScrollable="); |
| 28 if (m_userScrollableHorizontal && m_userScrollableVertical) | 29 if (m_userScrollableHorizontal && m_userScrollableVertical) |
| 29 text.append("both"); | 30 text.append("both"); |
| 30 else if (!m_userScrollableHorizontal && !m_userScrollableVertical) | 31 else if (!m_userScrollableHorizontal && !m_userScrollableVertical) |
| 31 text.append("none"); | 32 text.append("none"); |
| 32 else | 33 else |
| 33 text.append(m_userScrollableHorizontal ? "horizontal" : "vertical"); | 34 text.append(m_userScrollableHorizontal ? "horizontal" : "vertical"); |
| 34 | 35 |
| 35 text.append(" mainThreadReasons="); | 36 text.append(" mainThreadReasons="); |
| 36 if (m_mainThreadScrollingReasons) { | 37 if (m_mainThreadScrollingReasons) { |
| 37 text.append(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( | 38 text.append(MainThreadScrollingReason::mainThreadScrollingReasonsAsText( |
| 38 m_mainThreadScrollingReasons) | 39 m_mainThreadScrollingReasons) |
| 39 .c_str()); | 40 .c_str()); |
| 40 } else { | 41 } else { |
| 41 text.append("none"); | 42 text.append("none"); |
| 42 } | 43 } |
| 44 if (m_scrollClient) |
| 45 text.append(String::format(" scrollClient=%p", m_scrollClient)); |
| 43 return text.toString(); | 46 return text.toString(); |
| 44 } | 47 } |
| 45 | 48 |
| 46 #if DCHECK_IS_ON() | 49 #if DCHECK_IS_ON() |
| 47 | 50 |
| 48 String ScrollPaintPropertyNode::toTreeString() const { | 51 String ScrollPaintPropertyNode::toTreeString() const { |
| 49 return blink::PropertyTreeStatePrinter<blink::ScrollPaintPropertyNode>() | 52 return blink::PropertyTreeStatePrinter<blink::ScrollPaintPropertyNode>() |
| 50 .pathAsString(this); | 53 .pathAsString(this); |
| 51 } | 54 } |
| 52 | 55 |
| 53 #endif | 56 #endif |
| 54 | 57 |
| 55 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |