Index: content/browser/gpu/browser_native_pixmap_manager_ozone.cc |
diff --git a/content/browser/gpu/browser_native_pixmap_manager_ozone.cc b/content/browser/gpu/browser_native_pixmap_manager_ozone.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7c0b27d0f2a69096bd789938f2ba44341c1ed4d9 |
--- /dev/null |
+++ b/content/browser/gpu/browser_native_pixmap_manager_ozone.cc |
@@ -0,0 +1,41 @@ |
+// 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/browser/gpu/browser_native_pixmap_manager_ozone.h" |
+ |
+#include "base/file_descriptor_posix.h" |
+#include "base/memory/singleton.h" |
+ |
+namespace content { |
+ |
+struct BrowserNativePixmapManagerTrait |
+ : public DefaultSingletonTraits<BrowserNativePixmapManager> { |
+ static BrowserNativePixmapManager* New() { |
+ BrowserNativePixmapManager* manager = new BrowserNativePixmapManager(); |
+ manager->Initialize(base::FileDescriptor()); |
+ return manager; |
+ } |
+}; |
+ |
+// static |
+BrowserNativePixmapManager* BrowserNativePixmapManager::GetInstance() { |
+ return Singleton<BrowserNativePixmapManager, |
+ BrowserNativePixmapManagerTrait>::get(); |
+} |
+ |
+BrowserNativePixmapManager::BrowserNativePixmapManager() {} |
+ |
+BrowserNativePixmapManager::~BrowserNativePixmapManager() {} |
+ |
+void BrowserNativePixmapManager::Initialize( |
+ const base::FileDescriptor& device_fd) { |
+ pixmap_manager_ = ui::NativePixmapManager::Create(device_fd); |
+} |
+ |
+std::vector<ui::NativePixmapManager::Configuration> |
+BrowserNativePixmapManager::GetSupportedNativePixmapConfigurations() const { |
+ return pixmap_manager_->GetSupportedNativePixmapConfigurations(); |
+} |
+ |
+} // namespace content |