Index: ui/ozone/public/client_native_pixmap_manager.h |
diff --git a/ui/ozone/public/client_native_pixmap_manager.h b/ui/ozone/public/client_native_pixmap_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..72af873019f43b09f8b47c8fe841805721a9fb49 |
--- /dev/null |
+++ b/ui/ozone/public/client_native_pixmap_manager.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ |
+#define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ |
+ |
+#include <vector> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "ui/gfx/geometry/size.h" |
+#include "ui/ozone/ozone_export.h" |
+#include "ui/ozone/public/client_native_pixmap.h" |
+#include "ui/ozone/public/native_pixmap_types.h" |
+ |
+namespace base { |
+ |
+struct FileDescriptor; |
+ |
+} // namespace base |
+ |
+namespace ui { |
+ |
+// The Ozone interface allows external implementations to hook into Chromium to |
+// provide a client pixmap for non-GPU processes. |
+class OZONE_EXPORT ClientNativePixmapManager { |
spang
2015/08/01 02:14:56
I know this is a bit burdensome, but can you name
reveman
2015/08/01 03:03:13
sgtm
dshwang
2015/08/03 12:51:48
Done.
|
+ public: |
+ static ClientNativePixmapManager* GetInstance(); |
+ static void SetInstance(ClientNativePixmapManager* instance); |
+ |
+ static scoped_ptr<ClientNativePixmapManager> Create(); |
+ |
+ virtual ~ClientNativePixmapManager(); |
+ |
+ struct Configuration { |
+ NativePixmapFormat format; |
+ NativePixmapUsage usage; |
+ }; |
+ |
+ // Gets supported format/usage configurations. |
+ virtual std::vector<Configuration> GetSupportedConfigurations() const = 0; |
spang
2015/08/01 02:14:56
I don't think it belongs here.
The client doesn't
reveman
2015/08/01 03:03:13
+1
dshwang
2015/08/03 12:51:48
That makes sense but it requires huge change.
Note
spang
2015/08/03 18:24:51
Ah, ok, I see your point about selecting native vs
|
+ |
+ // TODO(dshwang): implement it. crbug.com/475633 |
+ // Import the native pixmap from |handle| to be used in non-GPU processes. |
+ virtual scoped_ptr<ClientNativePixmap> ImportNativePixmap( |
+ const base::FileDescriptor& handle, |
+ const gfx::Size& size, |
+ NativePixmapFormat format, |
+ NativePixmapUsage usage) = 0; |
+ |
+ protected: |
+ ClientNativePixmapManager(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapManager); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ |