Commit adb4651a authored by Liquan(Max) Gu's avatar Liquan(Max) Gu Committed by Commit Bot

[FCP++] Rename PaintTracking flag to FCPPlusPlus

Rename PaintTracking flag to FirstContentfulPaintPlusPlus. The flag is meant to
serve specifically to FCP++ metrics. So the naming should reflect this goal.

This CL renames the PaintTracking flag in runtime_enabled_features.

Bug: 869924
Change-Id: Ib3cbd8ac21ab962e87626edf74e13dfc8fde486e
Reviewed-on: https://chromium-review.googlesource.com/c/1338237
Commit-Queue: Liquan (Max) Gǔ <maxlg@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608524}
parent 3cd201f7
...@@ -3262,7 +3262,7 @@ void LayoutObject::WillBeRemovedFromTree() { ...@@ -3262,7 +3262,7 @@ void LayoutObject::WillBeRemovedFromTree() {
FindReferencingScrollAnchors(this, kClear); FindReferencingScrollAnchors(this, kClear);
} }
if (RuntimeEnabledFeatures::PaintTrackingEnabled()) { if (RuntimeEnabledFeatures::FirstContentfulPaintPlusPlusEnabled()) {
if (LocalFrameView* frame_view = GetFrameView()) { if (LocalFrameView* frame_view = GetFrameView()) {
frame_view->GetPaintTracker().NotifyNodeRemoved(*this); frame_view->GetPaintTracker().NotifyNodeRemoved(*this);
} }
......
...@@ -21,13 +21,15 @@ ...@@ -21,13 +21,15 @@
namespace blink { namespace blink {
class ImagePaintTimingDetectorTest : public PageTestBase, class ImagePaintTimingDetectorTest
private ScopedPaintTrackingForTest { : public PageTestBase,
private ScopedFirstContentfulPaintPlusPlusForTest {
using CallbackQueue = std::queue<WebLayerTreeView::ReportTimeCallback>; using CallbackQueue = std::queue<WebLayerTreeView::ReportTimeCallback>;
public: public:
ImagePaintTimingDetectorTest() ImagePaintTimingDetectorTest()
: ScopedPaintTrackingForTest(true), base_url_("http://www.test.com/"){}; : ScopedFirstContentfulPaintPlusPlusForTest(true),
base_url_("http://www.test.com/"){};
~ImagePaintTimingDetectorTest() override { ~ImagePaintTimingDetectorTest() override {
Platform::Current() Platform::Current()
......
...@@ -133,7 +133,7 @@ void PrePaintTreeWalk::Walk(LocalFrameView& frame_view) { ...@@ -133,7 +133,7 @@ void PrePaintTreeWalk::Walk(LocalFrameView& frame_view) {
if (RuntimeEnabledFeatures::JankTrackingEnabled()) if (RuntimeEnabledFeatures::JankTrackingEnabled())
frame_view.GetJankTracker().NotifyPrePaintFinished(); frame_view.GetJankTracker().NotifyPrePaintFinished();
if (RuntimeEnabledFeatures::PaintTrackingEnabled()) if (RuntimeEnabledFeatures::FirstContentfulPaintPlusPlusEnabled())
frame_view.GetPaintTracker().NotifyPrePaintFinished(); frame_view.GetPaintTracker().NotifyPrePaintFinished();
context_storage_.pop_back(); context_storage_.pop_back();
...@@ -375,7 +375,7 @@ void PrePaintTreeWalk::WalkInternal(const LayoutObject& object, ...@@ -375,7 +375,7 @@ void PrePaintTreeWalk::WalkInternal(const LayoutObject& object,
object, paint_invalidator_context.old_visual_rect, object, paint_invalidator_context.old_visual_rect,
*paint_invalidator_context.painting_layer); *paint_invalidator_context.painting_layer);
} }
if (RuntimeEnabledFeatures::PaintTrackingEnabled()) { if (RuntimeEnabledFeatures::FirstContentfulPaintPlusPlusEnabled()) {
object.GetFrameView()->GetPaintTracker().NotifyObjectPrePaint( object.GetFrameView()->GetPaintTracker().NotifyObjectPrePaint(
object, *paint_invalidator_context.painting_layer); object, *paint_invalidator_context.painting_layer);
} }
......
...@@ -6,15 +6,17 @@ ...@@ -6,15 +6,17 @@
#include "third_party/blink/renderer/core/paint/paint_tracker.h" #include "third_party/blink/renderer/core/paint/paint_tracker.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
namespace blink { namespace blink {
class TextPaintTimingDetectorTest : public RenderingTest { class TextPaintTimingDetectorTest
: public RenderingTest,
private ScopedFirstContentfulPaintPlusPlusForTest {
public: public:
void SetUp() override { TextPaintTimingDetectorTest()
RenderingTest::SetUp(); : ScopedFirstContentfulPaintPlusPlusForTest(true) {}
RuntimeEnabledFeatures::SetPaintTrackingEnabled(true); void SetUp() override { RenderingTest::SetUp(); }
}
protected: protected:
LocalFrameView& GetFrameView() { return *GetFrame().View(); } LocalFrameView& GetFrameView() { return *GetFrame().View(); }
......
...@@ -488,6 +488,12 @@ ...@@ -488,6 +488,12 @@
name: "FileSystem", name: "FileSystem",
status: "stable", status: "stable",
}, },
// FirstContentfulPaintPlusPlus enables the Largest Text Paint metric, Last
// Text Paint metric, Largest Image Paint metric and Last Image Paint
// metric. See also: http://bit.ly/fcp_plus_plus
{
name: "FirstContentfulPaintPlusPlus",
},
{ {
name: "FontCacheScaling", name: "FontCacheScaling",
status: "test", status: "test",
...@@ -906,12 +912,6 @@ ...@@ -906,12 +912,6 @@
name: "PaintTouchActionRects", name: "PaintTouchActionRects",
status: "stable", status: "stable",
}, },
// PaintTracking enables the Largest Text Paint metric, Last Text Paint
// metric, Largest Image Paint metric and Last Image Paint metric.
// See also: https://docs.google.com/document/d/1DRVd4a2VU8-yyWftgOparZF-sf16daf0vfbsHuz2rws/edit
{
name: "PaintTracking",
},
{ {
name: "PaintUnderInvalidationChecking", name: "PaintUnderInvalidationChecking",
settable_from_internals: true, settable_from_internals: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment