| Index: ui/ozone/public/ozone_platform.h
|
| diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
|
| index 95e5d5bd3015c740ca7cff1c905268f30a2317a7..5757660809d25f9864b46a9fef17a7188e54bed1 100644
|
| --- a/ui/ozone/public/ozone_platform.h
|
| +++ b/ui/ozone/public/ozone_platform.h
|
| @@ -14,6 +14,11 @@ namespace gfx {
|
| class Rect;
|
| }
|
|
|
| +namespace shell {
|
| +class Connector;
|
| +class Connection;
|
| +}
|
| +
|
| namespace ui {
|
|
|
| class CursorFactoryOzone;
|
| @@ -46,13 +51,39 @@ class OZONE_EXPORT OzonePlatform {
|
| OzonePlatform();
|
| virtual ~OzonePlatform();
|
|
|
| + // Additional initalization params for the platform. Platforms must not retain
|
| + // a reference to this structure.
|
| + struct InitParams {
|
| + // Ozone may retain this pointer for later use. An Ozone platform embedder
|
| + // must set this parameter in order for the Ozone platform implementation to
|
| + // be able to use Mojo.
|
| + shell::Connector* connector = nullptr;
|
| +
|
| + // Setting this to true indicates that the platform implementation should
|
| + // operate as a single process for platforms (i.e. drm) that are usually
|
| + // split between a main and gpu specific portion.
|
| + bool single_process = false;
|
| + };
|
| +
|
| // Initializes the subsystems/resources necessary for the UI process (e.g.
|
| - // events, surface, etc.)
|
| + // events, etc.)
|
| + // TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934)
|
| static void InitializeForUI();
|
|
|
| - // Initializes the subsystems/resources necessary for the GPU process.
|
| + // Initializes the subsystems/resources necessary for the UI process (e.g.
|
| + // events) with additional properties to customize the ozone platform
|
| + // implementation. Ozone will not retain InitParams after returning from
|
| + // InitalizeForUI.
|
| + static void InitializeForUI(const InitParams& args);
|
| +
|
| + // Initializes the subsystems/resources necessary for rendering (i.e. GPU).
|
| + // TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934)
|
| static void InitializeForGPU();
|
|
|
| + // Initializes the subsystems for rendering but with additional properties
|
| + // provided by |args| as with InitalizeForUI.
|
| + static void InitializeForGPU(const InitParams& args);
|
| +
|
| static OzonePlatform* GetInstance();
|
|
|
| // Factory getters to override in subclasses. The returned objects will be
|
| @@ -71,9 +102,20 @@ class OZONE_EXPORT OzonePlatform {
|
| virtual std::unique_ptr<ui::NativeDisplayDelegate>
|
| CreateNativeDisplayDelegate() = 0;
|
|
|
| + // Ozone platform implementations may also choose to expose mojo interfaces to
|
| + // internal functionality. Embedders wishing to take advantage of ozone mojo
|
| + // implementations must invoke AddInterfaces with a valid shell::Connection*
|
| + // pointer to export all Mojo interfaces defined within Ozone.
|
| + //
|
| + // A default do-nothing implementation is provided to permit platform
|
| + // implementations to opt out of implementing any Mojo interfaces.
|
| + virtual void AddInterfaces(shell::Connection* connection);
|
| +
|
| private:
|
| virtual void InitializeUI() = 0;
|
| virtual void InitializeGPU() = 0;
|
| + virtual void InitializeUI(const InitParams& args);
|
| + virtual void InitializeGPU(const InitParams& args);
|
|
|
| static void CreateInstance();
|
|
|
|
|