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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2380683006: SPv2: Add support for tracking raster paint invalidations in testing. (Closed)
Patch Set: none Created 4 years, 2 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/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 6f5347971b191cb4fefc79cb6e5990ff7c33e0e8..abd6e8f63e13730ed35330d38dd3ae56f6ea984b 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -803,22 +803,26 @@ String LocalFrame::layerTreeAsText(unsigned flags) const {
if (contentLayoutItem().isNull())
return String();
- std::unique_ptr<JSONObject> layerTree =
- contentLayoutItem().compositor()->layerTreeAsJSON(
- static_cast<LayerTreeFlags>(flags));
+ std::unique_ptr<JSONObject> layers;
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ layers = view()->compositedLayersAsJSON(static_cast<LayerTreeFlags>(flags));
+ } else {
+ layers = contentLayoutItem().compositor()->layerTreeAsJSON(
+ static_cast<LayerTreeFlags>(flags));
+ }
if (flags & LayerTreeIncludesPaintInvalidations) {
std::unique_ptr<JSONArray> objectPaintInvalidations =
m_view->trackedObjectPaintInvalidationsAsJSON();
if (objectPaintInvalidations && objectPaintInvalidations->size()) {
- if (!layerTree)
- layerTree = JSONObject::create();
- layerTree->setArray("objectPaintInvalidations",
- std::move(objectPaintInvalidations));
+ if (!layers)
+ layers = JSONObject::create();
+ layers->setArray("objectPaintInvalidations",
+ std::move(objectPaintInvalidations));
}
}
- return layerTree ? layerTree->toPrettyJSONString() : String();
+ return layers ? layers->toPrettyJSONString() : String();
}
bool LocalFrame::shouldThrottleRendering() const {

Powered by Google App Engine
This is Rietveld 408576698