Index: content/child/child_client_native_pixmap_factory_ozone.cc |
diff --git a/content/child/child_client_native_pixmap_factory_ozone.cc b/content/child/child_client_native_pixmap_factory_ozone.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6470bbea51f0f74bfcf0f9436b543eb3bae810b2 |
--- /dev/null |
+++ b/content/child/child_client_native_pixmap_factory_ozone.cc |
@@ -0,0 +1,50 @@ |
+// 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. |
+ |
+#include "content/child/child_client_native_pixmap_factory_ozone.h" |
+ |
+#include "base/file_descriptor_posix.h" |
+#include "base/memory/singleton.h" |
+ |
+namespace content { |
+ |
+struct ChildClientNativePixmapFactoryTrait |
+ : public DefaultSingletonTraits<ChildClientNativePixmapFactory> { |
+ static ChildClientNativePixmapFactory* New() { |
+ ChildClientNativePixmapFactory* manager = |
+ new ChildClientNativePixmapFactory(); |
+ return manager; |
+ } |
+}; |
+ |
+// static |
+ChildClientNativePixmapFactory* ChildClientNativePixmapFactory::GetInstance() { |
+ return Singleton<ChildClientNativePixmapFactory, |
+ ChildClientNativePixmapFactoryTrait>::get(); |
+} |
+ |
+ChildClientNativePixmapFactory::ChildClientNativePixmapFactory() {} |
+ |
+ChildClientNativePixmapFactory::~ChildClientNativePixmapFactory() {} |
+ |
+void ChildClientNativePixmapFactory::Initialize( |
+ const base::FileDescriptor& virtual_device) { |
+ pixmap_factory_ = ui::ClientNativePixmapFactory::Create(virtual_device); |
+} |
+ |
+std::vector<ui::ClientNativePixmapFactory::Configuration> |
+ChildClientNativePixmapFactory::GetSupportedConfigurations() const { |
+ return pixmap_factory_->GetSupportedConfigurations(); |
+} |
+ |
+scoped_ptr<ui::ClientNativePixmap> |
+ChildClientNativePixmapFactory::ImportNativePixmap( |
+ const base::FileDescriptor& handle, |
+ const gfx::Size& size, |
+ gfx::BufferFormat format, |
+ gfx::BufferUsage usage) { |
+ return pixmap_factory_->ImportNativePixmap(handle, size, format, usage); |
+} |
+ |
+} // namespace content |