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

Unified 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: main thread scrlling reasons added to GraphicsLayerDebugInfo. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
index 417aac87d1d16c30e926cc9534f80a240178629b..bb038dd3bf42391054f834e5acaa2159363ce7b2 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
@@ -20,6 +20,9 @@
#include "platform/graphics/GraphicsLayerDebugInfo.h"
#include "base/trace_event/trace_event_argument.h"
+#include "platform/scroll/MainThreadScrollingReason.h"
+
+#include <vector>
namespace blink {
@@ -27,6 +30,7 @@ GraphicsLayerDebugInfo::GraphicsLayerDebugInfo()
: m_compositingReasons(CompositingReasonNone)
, m_squashingDisallowedReasons(SquashingDisallowedReasonsNone)
, m_ownerNodeId(0)
+ , m_mainThreadScrollingReasons(0)
{
}
@@ -40,6 +44,7 @@ std::unique_ptr<base::trace_event::TracedValue> GraphicsLayerDebugInfo::asTraced
appendCompositingReasons(tracedValue.get());
appendSquashingDisallowedReasons(tracedValue.get());
appendOwnerNodeId(tracedValue.get());
+ appendMainThreadScrollingReasons(tracedValue.get());
return tracedValue;
}
@@ -106,4 +111,15 @@ void GraphicsLayerDebugInfo::clearAnnotatedInvalidateRects()
m_previousInvalidations.swap(m_invalidations);
}
+void GraphicsLayerDebugInfo::appendMainThreadScrollingReasons(base::trace_event::TracedValue* tracedValue) const
+{
+ std::vector<std::string> reasons = MainThreadScrollingReason::mainThreadScrollingReasonsAsStringArray(m_mainThreadScrollingReasons);
+ size_t arraySize = reasons.size();
+ tracedValue->BeginArray("main_thread_scrolling_reasons");
+ for (size_t i = 0; i < arraySize; ++i) {
+ tracedValue->AppendString(reasons[i]);
+ }
+ tracedValue->EndArray();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698