Commit 03268a47 authored by dnicoara@chromium.org's avatar dnicoara@chromium.org

[Ozone] Removing Stub SFO implementation & CreateTestHelper from SFO

Given we now use the OzonePlatform to initialize SFO and we already have a test
implementation(the file backend), the Stub implementation isn't required. After
the removal the unittests will default to using the file backend.

This change also fixes the recent brakage of aura_unittests since the Stub SFO
returns 0 (kNullAcceleratedWidget) for a widget, which triggers a DCHECK
failure in WindowTreeHost::DestroyCompositor.

BUG=

Review URL: https://codereview.chromium.org/131493005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245377 0039d316-1c4b-4281-b951-d872f2087c98
parent 34f93392
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#endif #endif
#if defined(USE_OZONE)
#include "ui/gfx/ozone/surface_factory_ozone.h"
#endif
namespace aura { namespace aura {
namespace test { namespace test {
...@@ -49,10 +45,6 @@ AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop) ...@@ -49,10 +45,6 @@ AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop)
#if defined(USE_X11) #if defined(USE_X11)
test::SetUseOverrideRedirectWindowByDefault(true); test::SetUseOverrideRedirectWindowByDefault(true);
#endif #endif
#if defined(USE_OZONE)
surface_factory_.reset(gfx::SurfaceFactoryOzone::CreateTestHelper());
gfx::SurfaceFactoryOzone::SetInstance(surface_factory_.get());
#endif
} }
AuraTestHelper::~AuraTestHelper() { AuraTestHelper::~AuraTestHelper() {
......
...@@ -13,10 +13,6 @@ namespace base { ...@@ -13,10 +13,6 @@ namespace base {
class MessageLoopForUI; class MessageLoopForUI;
} }
namespace gfx {
class SurfaceFactoryOzone;
}
namespace ui { namespace ui {
class InputMethod; class InputMethod;
class ScopedAnimationDurationScaleMode; class ScopedAnimationDurationScaleMode;
...@@ -69,10 +65,6 @@ class AuraTestHelper { ...@@ -69,10 +65,6 @@ class AuraTestHelper {
scoped_ptr<TestScreen> test_screen_; scoped_ptr<TestScreen> test_screen_;
scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
#if defined(USE_OZONE)
scoped_ptr<gfx::SurfaceFactoryOzone> surface_factory_;
#endif
DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); DISALLOW_COPY_AND_ASSIGN(AuraTestHelper);
}; };
......
...@@ -14,34 +14,6 @@ namespace gfx { ...@@ -14,34 +14,6 @@ namespace gfx {
// static // static
SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL; SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL;
class SurfaceFactoryOzoneStub : public SurfaceFactoryOzone {
public:
SurfaceFactoryOzoneStub() {}
virtual ~SurfaceFactoryOzoneStub() {}
virtual HardwareState InitializeHardware() OVERRIDE { return INITIALIZED; }
virtual void ShutdownHardware() OVERRIDE {}
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE { return 0; }
virtual gfx::AcceleratedWidget RealizeAcceleratedWidget(
gfx::AcceleratedWidget w) OVERRIDE {
return 0;
}
virtual bool LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
SetGLGetProcAddressProcCallback set_gl_get_proc_address) OVERRIDE {
return true;
}
virtual bool AttemptToResizeAcceleratedWidget(
gfx::AcceleratedWidget w,
const gfx::Rect& bounds) OVERRIDE {
return false;
}
virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider(
gfx::AcceleratedWidget w) OVERRIDE {
return scoped_ptr<VSyncProvider>();
}
};
SurfaceFactoryOzone::SurfaceFactoryOzone() { SurfaceFactoryOzone::SurfaceFactoryOzone() {
} }
...@@ -85,9 +57,4 @@ const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties( ...@@ -85,9 +57,4 @@ const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties(
return desired_attributes; return desired_attributes;
} }
// static
SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() {
return new SurfaceFactoryOzoneStub;
}
} // namespace gfx } // namespace gfx
...@@ -137,9 +137,6 @@ class GFX_EXPORT SurfaceFactoryOzone { ...@@ -137,9 +137,6 @@ class GFX_EXPORT SurfaceFactoryOzone {
// caller. desired_list contains list of desired EGL properties and values. // caller. desired_list contains list of desired EGL properties and values.
virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); virtual const int32* GetEGLSurfaceProperties(const int32* desired_list);
// Create a default SufaceFactoryOzone implementation useful for tests.
static SurfaceFactoryOzone* CreateTestHelper();
private: private:
static SurfaceFactoryOzone* impl_; // not owned static SurfaceFactoryOzone* impl_; // not owned
}; };
......
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