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

Side by Side Diff: ui/ozone/public/ozone_client.h

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce OzoneClient Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PUBLIC_OZONE_CLIENT_H_
6 #define UI_OZONE_PUBLIC_OZONE_CLIENT_H_
7
8 #include "ui/ozone/ozone_export.h"
9
10 namespace ui {
11
12 class SurfaceClientFactoryOzone;
13
14 // Base class for Ozone client implementations. Render process and UI process
15 // use OzoneClient instead of OzonePlatform to access Ozone specific
16 // features. e.g. share a surface created by GPU process
17 //
18 // UI process uses both OzoneClient and OzonePlatform but the purpose is
19 // different. UI process initializes subsystems (e.g. events, surface) via
20 // OzonePlatform, while OzoneClient is used for ozone client purpose.
21 // (e.g. surface sharing)
22 //
23 // Each Ozone platforms override this class and implement the virtual
24 // GetFooFactoryOzone() methods to provide implementations of the
25 // various ozone interfaces.
26 //
27 // A platform is free to use different implementations of each
28 // interface depending on the context. You can, for example, create
29 // different objects depending on the underlying hardware, command
30 // line flags, or whatever is appropriate for the platform.
31 class OZONE_EXPORT OzoneClient {
32 public:
33 OzoneClient();
34 virtual ~OzoneClient();
35
36 // Initializes the resources necessary for the UI process.
37 static void InitializeForUI();
38
39 // Initializes the resources necessary for the Render process.
40 static void InitializeForRenderer();
spang 2015/06/01 22:46:41 Why are these functions separate but do the same t
dshwang 2015/06/03 14:11:51 Sure, I comments future plan in NativePixmapClient
41
42 static OzoneClient* GetInstance();
43
44 // Factory getters to override in subclasses. The returned objects will be
45 // injected into the appropriate layer at startup. Subclasses should not
46 // inject these objects themselves. Ownership is retained by OzoneClient.
47 virtual SurfaceClientFactoryOzone* GetSurfaceClientFactoryOzone() = 0;
48
49 private:
50 virtual void InitializeUI() = 0;
51 virtual void InitializeRenderer() = 0;
52
53 static void CreateInstance();
54
55 DISALLOW_COPY_AND_ASSIGN(OzoneClient);
56 };
57
58 } // namespace ui
59
60 #endif // UI_OZONE_PUBLIC_OZONE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698