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

Unified Diff: ui/compositor/compositor.h

Issue 45963003: Move test-only ContextFactory implementations out of production targets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert bad ui/base changes Created 7 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: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 89929698479f7c7ac4372d716571cf76fc1909b8..513822ac022e51b491f0d2012015129bccd8baf7 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -34,7 +34,6 @@ class ContextProvider;
class Layer;
class LayerTreeDebugState;
class LayerTreeHost;
-class TestContextProvider;
}
namespace gfx {
@@ -117,68 +116,6 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual bool DoesCreateTestContexts() = 0;
};
-// The default factory that creates in-process contexts.
-class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory {
- public:
- DefaultContextFactory();
- virtual ~DefaultContextFactory();
-
- // ContextFactory implementation
- virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
- Compositor* compositor) OVERRIDE;
-
- virtual scoped_refptr<Reflector> CreateReflector(
- Compositor* compositor,
- Layer* layer) OVERRIDE;
- virtual void RemoveReflector(scoped_refptr<Reflector> reflector) OVERRIDE;
-
- virtual scoped_refptr<cc::ContextProvider>
- OffscreenCompositorContextProvider() OVERRIDE;
- virtual scoped_refptr<cc::ContextProvider>
- SharedMainThreadContextProvider() OVERRIDE;
- virtual void RemoveCompositor(Compositor* compositor) OVERRIDE;
- virtual bool DoesCreateTestContexts() OVERRIDE;
-
- bool Initialize();
-
- private:
- scoped_refptr<webkit::gpu::ContextProviderInProcess>
- offscreen_compositor_contexts_;
- scoped_refptr<webkit::gpu::ContextProviderInProcess>
- shared_main_thread_contexts_;
-
- DISALLOW_COPY_AND_ASSIGN(DefaultContextFactory);
-};
-
-// The factory that creates test contexts.
-class COMPOSITOR_EXPORT TestContextFactory : public ContextFactory {
- public:
- TestContextFactory();
- virtual ~TestContextFactory();
-
- // ContextFactory implementation
- virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
- Compositor* compositor) OVERRIDE;
-
- virtual scoped_refptr<Reflector> CreateReflector(
- Compositor* mirrored_compositor,
- Layer* mirroring_layer) OVERRIDE;
- virtual void RemoveReflector(scoped_refptr<Reflector> reflector) OVERRIDE;
-
- virtual scoped_refptr<cc::ContextProvider>
- OffscreenCompositorContextProvider() OVERRIDE;
- virtual scoped_refptr<cc::ContextProvider>
- SharedMainThreadContextProvider() OVERRIDE;
- virtual void RemoveCompositor(Compositor* compositor) OVERRIDE;
- virtual bool DoesCreateTestContexts() OVERRIDE;
-
- private:
- scoped_refptr<cc::TestContextProvider> offscreen_compositor_contexts_;
- scoped_refptr<cc::TestContextProvider> shared_main_thread_contexts_;
-
- DISALLOW_COPY_AND_ASSIGN(TestContextFactory);
-};
-
// Texture provide an abstraction over the external texture that can be passed
// to a layer.
class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> {
@@ -288,14 +225,6 @@ class COMPOSITOR_EXPORT Compositor
gfx::AcceleratedWidget widget);
virtual ~Compositor();
- // Set up the compositor ContextFactory for a test environment. Unit tests
- // that do not have a full content environment need to call this before
- // initializing the Compositor.
- // Some tests expect pixel output, and they should pass false for
- // |allow_test_contexts|. Most unit tests should pass true. Once this has been
- // called, the Initialize() and Terminate() methods should be used as normal.
- static void InitializeContextFactoryForTests(bool allow_test_contexts);
-
static void Initialize();
static bool WasInitializedWithThread();
static scoped_refptr<base::MessageLoopProxy> GetCompositorMessageLoop();

Powered by Google App Engine
This is Rietveld 408576698