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

Side by Side Diff: ui/ozone/ozone_platform.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gl/gl_implementation_ozone.cc ('k') | ui/ozone/ozone_platform.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_OZONE_OZONE_PLATFORM_H_ 5 #ifndef UI_OZONE_OZONE_PLATFORM_H_
6 #define UI_OZONE_OZONE_PLATFORM_H_ 6 #define UI_OZONE_OZONE_PLATFORM_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/ozone/ozone_export.h" 9 #include "ui/ozone/ozone_export.h"
10 10
(...skipping 20 matching lines...) Expand all
31 // 31 //
32 // A platform is free to use different implementations of each 32 // A platform is free to use different implementations of each
33 // interface depending on the context. You can, for example, create 33 // interface depending on the context. You can, for example, create
34 // different objects depending on the underlying hardware, command 34 // different objects depending on the underlying hardware, command
35 // line flags, or whatever is appropriate for the platform. 35 // line flags, or whatever is appropriate for the platform.
36 class OZONE_EXPORT OzonePlatform { 36 class OZONE_EXPORT OzonePlatform {
37 public: 37 public:
38 OzonePlatform(); 38 OzonePlatform();
39 virtual ~OzonePlatform(); 39 virtual ~OzonePlatform();
40 40
41 // Initialize the platform. Once complete, SurfaceFactoryOzone & 41 // Initializes the subsystems/resources necessary for the UI process (e.g.
42 // EventFactoryOzone will be set. 42 // events, surface, etc.)
43 static void Initialize(); 43 static void InitializeForUI();
44
45 // Initializes the subsystems/resources necessary for the GPU process.
46 static void InitializeForGPU();
44 47
45 static OzonePlatform* GetInstance(); 48 static OzonePlatform* GetInstance();
46 49
47 // Factory getters to override in subclasses. The returned objects will be 50 // Factory getters to override in subclasses. The returned objects will be
48 // injected into the appropriate layer at startup. Subclasses should not 51 // injected into the appropriate layer at startup. Subclasses should not
49 // inject these objects themselves. Ownership is retained by OzonePlatform. 52 // inject these objects themselves. Ownership is retained by OzonePlatform.
50 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; 53 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0;
51 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0; 54 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0;
52 virtual ui::InputMethodContextFactoryOzone* 55 virtual ui::InputMethodContextFactoryOzone*
53 GetInputMethodContextFactoryOzone() = 0; 56 GetInputMethodContextFactoryOzone() = 0;
54 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; 57 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0;
55 #if defined(OS_CHROMEOS) 58 #if defined(OS_CHROMEOS)
56 virtual scoped_ptr<ui::NativeDisplayDelegate> 59 virtual scoped_ptr<ui::NativeDisplayDelegate>
57 CreateNativeDisplayDelegate() = 0; 60 CreateNativeDisplayDelegate() = 0;
58 #endif 61 #endif
59 62
60 private: 63 private:
64 virtual void InitializeUI() = 0;
65 virtual void InitializeGPU() = 0;
66
67 static void CreateInstance();
68
61 static OzonePlatform* instance_; 69 static OzonePlatform* instance_;
62 70
63 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); 71 DISALLOW_COPY_AND_ASSIGN(OzonePlatform);
64 }; 72 };
65 73
66 } // namespace ui 74 } // namespace ui
67 75
68 #endif // UI_OZONE_OZONE_PLATFORM_H_ 76 #endif // UI_OZONE_OZONE_PLATFORM_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation_ozone.cc ('k') | ui/ozone/ozone_platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698