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

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

Issue 2015433004: Add main thread scrolling reasons to GraphicsLayer::layerTreeAsJSON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #include "platform/graphics/GraphicsLayerDebugInfo.h" 20 #include "platform/graphics/GraphicsLayerDebugInfo.h"
21 21
22 #include "base/trace_event/trace_event_argument.h" 22 #include "base/trace_event/trace_event_argument.h"
23 #include "platform/scroll/MainThreadScrollingReason.h"
23 24
24 namespace blink { 25 namespace blink {
25 26
26 GraphicsLayerDebugInfo::GraphicsLayerDebugInfo() 27 GraphicsLayerDebugInfo::GraphicsLayerDebugInfo()
27 : m_compositingReasons(CompositingReasonNone) 28 : m_compositingReasons(CompositingReasonNone)
28 , m_squashingDisallowedReasons(SquashingDisallowedReasonsNone) 29 , m_squashingDisallowedReasons(SquashingDisallowedReasonsNone)
29 , m_ownerNodeId(0) 30 , m_ownerNodeId(0)
31 , m_mainThreadScrollingReasons(0)
30 { 32 {
31 } 33 }
32 34
33 GraphicsLayerDebugInfo::~GraphicsLayerDebugInfo() { } 35 GraphicsLayerDebugInfo::~GraphicsLayerDebugInfo() { }
34 36
35 std::unique_ptr<base::trace_event::TracedValue> GraphicsLayerDebugInfo::asTraced Value() const 37 std::unique_ptr<base::trace_event::TracedValue> GraphicsLayerDebugInfo::asTraced Value() const
36 { 38 {
37 std::unique_ptr<base::trace_event::TracedValue> tracedValue( 39 std::unique_ptr<base::trace_event::TracedValue> tracedValue(
38 new base::trace_event::TracedValue()); 40 new base::trace_event::TracedValue());
39 appendAnnotatedInvalidateRects(tracedValue.get()); 41 appendAnnotatedInvalidateRects(tracedValue.get());
40 appendCompositingReasons(tracedValue.get()); 42 appendCompositingReasons(tracedValue.get());
41 appendSquashingDisallowedReasons(tracedValue.get()); 43 appendSquashingDisallowedReasons(tracedValue.get());
42 appendOwnerNodeId(tracedValue.get()); 44 appendOwnerNodeId(tracedValue.get());
45 appendMainThreadScrollingReasons(tracedValue.get());
43 return tracedValue; 46 return tracedValue;
44 } 47 }
45 48
46 void GraphicsLayerDebugInfo::appendAnnotatedInvalidateRects(base::trace_event::T racedValue* tracedValue) const 49 void GraphicsLayerDebugInfo::appendAnnotatedInvalidateRects(base::trace_event::T racedValue* tracedValue) const
47 { 50 {
48 tracedValue->BeginArray("annotated_invalidation_rects"); 51 tracedValue->BeginArray("annotated_invalidation_rects");
49 for (const auto& annotatedRect : m_previousInvalidations) { 52 for (const auto& annotatedRect : m_previousInvalidations) {
50 const FloatRect& rect = annotatedRect.rect; 53 const FloatRect& rect = annotatedRect.rect;
51 tracedValue->BeginDictionary(); 54 tracedValue->BeginDictionary();
52 tracedValue->BeginArray("geometry_rect"); 55 tracedValue->BeginArray("geometry_rect");
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 }; 102 };
100 m_invalidations.append(annotatedRect); 103 m_invalidations.append(annotatedRect);
101 } 104 }
102 105
103 void GraphicsLayerDebugInfo::clearAnnotatedInvalidateRects() 106 void GraphicsLayerDebugInfo::clearAnnotatedInvalidateRects()
104 { 107 {
105 m_previousInvalidations.clear(); 108 m_previousInvalidations.clear();
106 m_previousInvalidations.swap(m_invalidations); 109 m_previousInvalidations.swap(m_invalidations);
107 } 110 }
108 111
112 void GraphicsLayerDebugInfo::appendMainThreadScrollingReasons(base::trace_event: :TracedValue* tracedValue) const
113 {
114 MainThreadScrollingReason::mainThreadScrollingReasonsAsTracedValue(m_mainThr eadScrollingReasons, tracedValue);
115 }
116
109 } // namespace blink 117 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698