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

Unified Diff: ui/ozone/platform/egltest/ozone_platform_egltest.cc

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r270817 Created 6 years, 7 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
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_dri.cc ('k') | ui/ozone/platform/test/ozone_platform_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/egltest/ozone_platform_egltest.cc
diff --git a/ui/ozone/platform/egltest/ozone_platform_egltest.cc b/ui/ozone/platform/egltest/ozone_platform_egltest.cc
index d45cb225bfc8263a232cfcc1f5c7bd33abd61684..d75c786da9908193bbe9a064d317b99c5fc1e4a3 100644
--- a/ui/ozone/platform/egltest/ozone_platform_egltest.cc
+++ b/ui/ozone/platform/egltest/ozone_platform_egltest.cc
@@ -205,11 +205,7 @@ const int32* SurfaceFactoryEgltest::GetEGLSurfaceProperties(
// hardware platforms.
class OzonePlatformEgltest : public OzonePlatform {
public:
- OzonePlatformEgltest()
- : device_manager_(CreateDeviceManager()),
- surface_factory_ozone_(&eglplatform_shim_),
- event_factory_ozone_(NULL, device_manager_.get()),
- shim_initialized_(false) {}
+ OzonePlatformEgltest() : shim_initialized_(false) {}
virtual ~OzonePlatformEgltest() {
if (shim_initialized_)
eglplatform_shim_.ShimTerminate();
@@ -239,17 +235,17 @@ class OzonePlatformEgltest : public OzonePlatform {
// OzonePlatform:
virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
- return &surface_factory_ozone_;
+ return surface_factory_ozone_.get();
}
virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
- return &event_factory_ozone_;
+ return event_factory_ozone_.get();
}
virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
OVERRIDE {
- return &input_method_context_factory_ozone_;
+ return input_method_context_factory_ozone_.get();
}
virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
- return &cursor_factory_ozone_;
+ return cursor_factory_ozone_.get();
}
#if defined(OS_CHROMEOS)
@@ -259,13 +255,26 @@ class OzonePlatformEgltest : public OzonePlatform {
}
#endif
+ virtual void InitializeUI() OVERRIDE {
+ device_manager_ = CreateDeviceManager();
+ surface_factory_ozone_.reset(new SurfaceFactoryEgltest(&eglplatform_shim_));
+ event_factory_ozone_.reset(
+ new EventFactoryEvdev(NULL, device_manager_.get()));
+ input_method_context_factory_ozone_.reset(
+ new InputMethodContextFactoryOzone());
+ cursor_factory_ozone_.reset(new CursorFactoryOzone());
+ }
+
+ virtual void InitializeGPU() OVERRIDE {}
+
private:
LibeglplatformShimLoader eglplatform_shim_;
scoped_ptr<DeviceManager> device_manager_;
- SurfaceFactoryEgltest surface_factory_ozone_;
- EventFactoryEvdev event_factory_ozone_;
- InputMethodContextFactoryOzone input_method_context_factory_ozone_;
- CursorFactoryOzone cursor_factory_ozone_;
+ scoped_ptr<SurfaceFactoryEgltest> surface_factory_ozone_;
+ scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
+ scoped_ptr<InputMethodContextFactoryOzone>
+ input_method_context_factory_ozone_;
+ scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
bool shim_initialized_;
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_dri.cc ('k') | ui/ozone/platform/test/ozone_platform_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698