diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-05 20:12:47 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-05 20:12:47 +0000 |
commit | a6366937214521c35a5e040beb2913f0cde1b252 (patch) | |
tree | d7ff2446cd2dc8c007a46a551bb3676e32f166c3 /cc/test | |
parent | 5cdd8fd8e343dbaa131256302eb338eeac7eb2aa (diff) | |
download | chromium_src-a6366937214521c35a5e040beb2913f0cde1b252.zip chromium_src-a6366937214521c35a5e040beb2913f0cde1b252.tar.gz chromium_src-a6366937214521c35a5e040beb2913f0cde1b252.tar.bz2 |
Rename and unify paths for LayerTreeTest::CreateFakeOutputSurface.
This was called CreateFakeOutputSurfaceForTest because of the conflict
with another CreateFakeOutputSurface method. To avoid this confusion,
replace the CreateFakeOutputSurface() calls with direct calls to
FakeOutputSurface::Create3d().
Get all unit tests that use a FakeOutputSurface (everything except
pixel tests) to override CreateFakeOutputSurface instead of
CreateOutputSurface. This gives us a common point for all unit tests
to inject things onto the OutputSurface. We'll inject the frame rate
there in the future (moving it out of LayerTreeSettings).
R=jamesr
BUG=267140
Review URL: https://codereview.chromium.org/155343002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/fake_output_surface.h | 4 | ||||
-rw-r--r-- | cc/test/layer_tree_test.cc | 5 | ||||
-rw-r--r-- | cc/test/layer_tree_test.h | 7 |
3 files changed, 6 insertions, 10 deletions
diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h index c458dc6..1c91338 100644 --- a/cc/test/fake_output_surface.h +++ b/cc/test/fake_output_surface.h @@ -153,10 +153,6 @@ class FakeOutputSurface : public OutputSurface { scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; }; -static inline scoped_ptr<OutputSurface> CreateFakeOutputSurface() { - return FakeOutputSurface::Create3d().PassAs<OutputSurface>(); -} - } // namespace cc #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 333814d..986d20b 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -676,13 +676,12 @@ void LayerTreeTest::RunTestWithImplSidePainting() { scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) { scoped_ptr<FakeOutputSurface> output_surface = - CreateFakeOutputSurfaceForTest(fallback); - + CreateFakeOutputSurface(fallback); output_surface_ = output_surface.get(); return output_surface.PassAs<OutputSurface>(); } -scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurfaceForTest( +scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface( bool fallback) { if (delegating_renderer_) return FakeOutputSurface::CreateDelegating3d(); diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 0a047fa..c1ee380 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -185,11 +185,12 @@ class LayerTreeTest : public testing::Test, public TestHooks { FakeOutputSurface* output_surface() { return output_surface_; } int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; + // Override this for pixel tests, where you need a real output surface. virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE; - virtual scoped_refptr<ContextProvider> OffscreenContextProvider() OVERRIDE; + // Override this for unit tests, which should not produce pixel output. + virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback); - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurfaceForTest( - bool fallback); + virtual scoped_refptr<ContextProvider> OffscreenContextProvider() OVERRIDE; TestWebGraphicsContext3D* TestContext(); |