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

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

Issue 1248713002: ozone: ClientPixmapManager passes VGEM fd from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove redundant Pass() Created 5 years, 3 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
« no previous file with comments | « ui/ozone/platform/test/ozone_platform_test.cc ('k') | ui/ozone/public/ozone_platform.h » ('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 2015 The Chromium Authors. All rights reserved. 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 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_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ 5 #ifndef UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_
6 #define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ 6 #define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/scoped_file.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "ui/gfx/buffer_types.h" 12 #include "ui/gfx/buffer_types.h"
12 #include "ui/ozone/ozone_export.h" 13 #include "ui/ozone/ozone_export.h"
13 #include "ui/ozone/public/client_native_pixmap.h" 14 #include "ui/ozone/public/client_native_pixmap.h"
14 15
15 namespace gfx { 16 namespace gfx {
16 struct NativePixmapHandle; 17 struct NativePixmapHandle;
17 class Size; 18 class Size;
18 } 19 }
19 20
20 namespace base {
21
22 struct FileDescriptor;
23
24 } // namespace base
25
26 namespace ui { 21 namespace ui {
27 22
28 // The Ozone interface allows external implementations to hook into Chromium to 23 // The Ozone interface allows external implementations to hook into Chromium to
29 // provide a client pixmap for non-GPU processes. 24 // provide a client pixmap for non-GPU processes.
30 class OZONE_EXPORT ClientNativePixmapFactory { 25 class OZONE_EXPORT ClientNativePixmapFactory {
31 public: 26 public:
32 static ClientNativePixmapFactory* GetInstance(); 27 static ClientNativePixmapFactory* GetInstance();
33 static void SetInstance(ClientNativePixmapFactory* instance); 28 static void SetInstance(ClientNativePixmapFactory* instance);
34 29
35 static scoped_ptr<ClientNativePixmapFactory> Create(); 30 static scoped_ptr<ClientNativePixmapFactory> Create();
36 31
37 virtual ~ClientNativePixmapFactory(); 32 virtual ~ClientNativePixmapFactory();
38 33
34 // Initialize with the given client native pixmap |device_fd|.
35 virtual void Initialize(base::ScopedFD device_fd) = 0;
36
39 struct Configuration { 37 struct Configuration {
40 gfx::BufferFormat format; 38 gfx::BufferFormat format;
41 gfx::BufferUsage usage; 39 gfx::BufferUsage usage;
42 }; 40 };
43 41
44 // Gets supported format/usage configurations. 42 // Gets supported format/usage configurations.
45 virtual std::vector<Configuration> GetSupportedConfigurations() const = 0; 43 virtual std::vector<Configuration> GetSupportedConfigurations() const = 0;
46 44
47 // TODO(dshwang): implement it. crbug.com/475633 45 // TODO(dshwang): implement it. crbug.com/475633
48 // Import the native pixmap from |handle| to be used in non-GPU processes. 46 // Import the native pixmap from |handle| to be used in non-GPU processes.
49 // This function takes ownership of any file descriptors in |handle|. 47 // This function takes ownership of any file descriptors in |handle|.
50 virtual scoped_ptr<ClientNativePixmap> ImportFromHandle( 48 virtual scoped_ptr<ClientNativePixmap> ImportFromHandle(
51 const gfx::NativePixmapHandle& handle, 49 const gfx::NativePixmapHandle& handle,
52 const gfx::Size& size, 50 const gfx::Size& size,
53 gfx::BufferUsage usage) = 0; 51 gfx::BufferUsage usage) = 0;
54 52
55 protected: 53 protected:
56 ClientNativePixmapFactory(); 54 ClientNativePixmapFactory();
57 55
58 private: 56 private:
59 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactory); 57 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactory);
60 }; 58 };
61 59
62 } // namespace ui 60 } // namespace ui
63 61
64 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ 62 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/test/ozone_platform_test.cc ('k') | ui/ozone/public/ozone_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698