Commit c622c006 authored by Mingjing Zhang's avatar Mingjing Zhang Committed by Commit Bot

Move the starting of universal tracker to LayerTreeHostImpl

This change makes the creation of universal tracker optional for those
FrameSequenceTrackerCollections created out of LayerTreeHostImpl (e.g.
frame trackers for video and canvas). These trackers currently do not
make use of the universal tracker. Furthermore, the presence of the
universal tracker in these out-of-cc FrameSequenceTrackerCollections
may be related to flaky test failures (https://crbug.com/1001364).

Change-Id: I698dc3614018b95bad0b697ce17c3b2cf3214367
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811497Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Mingjing Zhang <mjzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698950}
parent 80da0627
......@@ -78,9 +78,7 @@ FrameSequenceTrackerCollection::FrameSequenceTrackerCollection(
CompositorFrameReportingController* compositor_frame_reporting_controller)
: is_single_threaded_(is_single_threaded),
compositor_frame_reporting_controller_(
compositor_frame_reporting_controller) {
StartSequence(FrameSequenceTrackerType::kUniversal);
}
compositor_frame_reporting_controller) {}
FrameSequenceTrackerCollection::~FrameSequenceTrackerCollection() {
frame_trackers_.clear();
......@@ -119,7 +117,6 @@ void FrameSequenceTrackerCollection::StopSequence(
void FrameSequenceTrackerCollection::ClearAll() {
frame_trackers_.clear();
removal_trackers_.clear();
StartSequence(FrameSequenceTrackerType::kUniversal);
}
void FrameSequenceTrackerCollection::NotifyBeginImplFrame(
......
......@@ -88,6 +88,8 @@ class FrameSequenceTrackerTest : public testing::Test {
// The kTouchScroll tracker is created in the test constructor, and the
// kUniversal tracker is created in the FrameSequenceTrackerCollection
// constructor.
EXPECT_EQ(collection_.frame_trackers_.size(), 3u);
collection_.StartSequence(FrameSequenceTrackerType::kUniversal);
EXPECT_EQ(collection_.frame_trackers_.size(), 4u);
collection_.StopSequence(kCompositorAnimation);
......@@ -152,13 +154,19 @@ TEST_F(FrameSequenceTrackerTest, SourceIdChangeDuringSequence) {
}
TEST_F(FrameSequenceTrackerTest, UniversalTrackerCreation) {
// The universal tracker should have been created when the |collection_| is
// created.
EXPECT_TRUE(TrackerExists(FrameSequenceTrackerType::kUniversal));
// The universal tracker should be explicitly created by the object that
// manages the |collection_|
EXPECT_FALSE(TrackerExists(FrameSequenceTrackerType::kUniversal));
}
TEST_F(FrameSequenceTrackerTest, UniversalTrackerExistsAfterClearAll) {
TEST_F(FrameSequenceTrackerTest, UniversalTrackerRestartableAfterClearAll) {
collection_.StartSequence(FrameSequenceTrackerType::kUniversal);
EXPECT_TRUE(TrackerExists(FrameSequenceTrackerType::kUniversal));
collection_.ClearAll();
EXPECT_FALSE(TrackerExists(FrameSequenceTrackerType::kUniversal));
collection_.StartSequence(FrameSequenceTrackerType::kUniversal);
EXPECT_TRUE(TrackerExists(FrameSequenceTrackerType::kUniversal));
}
......
......@@ -3466,6 +3466,8 @@ bool LayerTreeHostImpl::InitializeFrameSink(
has_valid_layer_tree_frame_sink_ = true;
auto* context_provider = layer_tree_frame_sink_->context_provider();
frame_trackers_.StartSequence(FrameSequenceTrackerType::kUniversal);
if (context_provider) {
max_texture_size_ =
context_provider->ContextCapabilities().max_texture_size;
......
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