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

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp

Issue 1705863002: [SPv2] Remove PaintArtifactCompositor::initializeIfNeeded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/compositing/PaintArtifactCompositorTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
index 426de6922b1a097bfe0074b571b42e2441929682..5def30a97f54fb3b002564e90a19c6013f0bfb0e 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -29,7 +29,9 @@ protected:
void SetUp() override
{
RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
- m_paintArtifactCompositor.initializeIfNeeded();
+
+ // Delay constructing the compositor until after the feature is set.
+ m_paintArtifactCompositor = adoptPtr(new PaintArtifactCompositor);
}
void TearDown() override
@@ -37,13 +39,13 @@ protected:
m_featuresBackup.restore();
}
- PaintArtifactCompositor& paintArtifactCompositor() { return m_paintArtifactCompositor; }
- cc::Layer* rootLayer() { return m_paintArtifactCompositor.rootLayer(); }
- void update(const PaintArtifact& artifact) { m_paintArtifactCompositor.update(artifact); }
+ PaintArtifactCompositor& paintArtifactCompositor() { return *m_paintArtifactCompositor; }
+ cc::Layer* rootLayer() { return m_paintArtifactCompositor->rootLayer(); }
+ void update(const PaintArtifact& artifact) { m_paintArtifactCompositor->update(artifact); }
private:
RuntimeEnabledFeatures::Backup m_featuresBackup;
- PaintArtifactCompositor m_paintArtifactCompositor;
+ OwnPtr<PaintArtifactCompositor> m_paintArtifactCompositor;
};
TEST_F(PaintArtifactCompositorTest, EmptyPaintArtifact)

Powered by Google App Engine
This is Rietveld 408576698