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

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

Issue 2647063002: Move property tree debugging code to platform/graphics/paint/ (try #2) (Closed)
Patch Set: none Created 3 years, 11 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
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/ScrollPaintPropertyNode.h" 5 #include "platform/graphics/paint/ScrollPaintPropertyNode.h"
6 6
7 #include "platform/graphics/paint/PropertyTreeState.h"
8
7 namespace blink { 9 namespace blink {
8 10
9 ScrollPaintPropertyNode* ScrollPaintPropertyNode::root() { 11 ScrollPaintPropertyNode* ScrollPaintPropertyNode::root() {
10 DEFINE_STATIC_REF(ScrollPaintPropertyNode, root, 12 DEFINE_STATIC_REF(ScrollPaintPropertyNode, root,
11 (ScrollPaintPropertyNode::create( 13 (ScrollPaintPropertyNode::create(
12 nullptr, TransformPaintPropertyNode::root(), IntSize(), 14 nullptr, TransformPaintPropertyNode::root(), IntSize(),
13 IntSize(), false, false, 0))); 15 IntSize(), false, false, 0)));
14 return root; 16 return root;
15 } 17 }
16 18
17 String ScrollPaintPropertyNode::toString() const { 19 String ScrollPaintPropertyNode::toString() const {
18 FloatSize scrollOffset = 20 FloatSize scrollOffset =
19 m_scrollOffsetTranslation->matrix().to2DTranslation(); 21 m_scrollOffsetTranslation->matrix().to2DTranslation();
20 std::string mainThreadScrollingReasonsAsText = 22 std::string mainThreadScrollingReasonsAsText =
21 MainThreadScrollingReason::mainThreadScrollingReasonsAsText( 23 MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
22 m_mainThreadScrollingReasons); 24 m_mainThreadScrollingReasons);
23 return String::format( 25 return String::format(
24 "parent=%p scrollOffsetTranslation=%s clip=%s bounds=%s " 26 "parent=%p scrollOffsetTranslation=%s clip=%s bounds=%s "
25 "userScrollableHorizontal=%s" 27 "userScrollableHorizontal=%s"
26 " userScrollableVertical=%s mainThreadScrollingReasons=%s", 28 " userScrollableVertical=%s mainThreadScrollingReasons=%s",
27 m_parent.get(), scrollOffset.toString().ascii().data(), 29 m_parent.get(), scrollOffset.toString().ascii().data(),
28 m_clip.toString().ascii().data(), m_bounds.toString().ascii().data(), 30 m_clip.toString().ascii().data(), m_bounds.toString().ascii().data(),
29 m_userScrollableHorizontal ? "yes" : "no", 31 m_userScrollableHorizontal ? "yes" : "no",
30 m_userScrollableVertical ? "yes" : "no", 32 m_userScrollableVertical ? "yes" : "no",
31 mainThreadScrollingReasonsAsText.c_str()); 33 mainThreadScrollingReasonsAsText.c_str());
32 } 34 }
33 35
36 #if DCHECK_IS_ON()
37
38 String ScrollPaintPropertyNode::toTreeString() const {
39 return blink::PropertyTreeStatePrinter<blink::ScrollPaintPropertyNode>()
40 .pathAsString(this);
41 }
42
43 #endif
44
34 } // namespace blink 45 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698