OLD | NEW |
(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 #include "content/browser/gpu/browser_native_pixmap_manager_ozone.h" |
| 6 |
| 7 #include "base/file_descriptor_posix.h" |
| 8 #include "base/memory/singleton.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 struct BrowserNativePixmapManagerTrait |
| 13 : public DefaultSingletonTraits<BrowserNativePixmapManager> { |
| 14 static BrowserNativePixmapManager* New() { |
| 15 BrowserNativePixmapManager* manager = new BrowserNativePixmapManager(); |
| 16 manager->Initialize(base::FileDescriptor()); |
| 17 return manager; |
| 18 } |
| 19 }; |
| 20 |
| 21 // static |
| 22 BrowserNativePixmapManager* BrowserNativePixmapManager::GetInstance() { |
| 23 return Singleton<BrowserNativePixmapManager, |
| 24 BrowserNativePixmapManagerTrait>::get(); |
| 25 } |
| 26 |
| 27 BrowserNativePixmapManager::BrowserNativePixmapManager() {} |
| 28 |
| 29 BrowserNativePixmapManager::~BrowserNativePixmapManager() {} |
| 30 |
| 31 void BrowserNativePixmapManager::Initialize( |
| 32 const base::FileDescriptor& device_fd) { |
| 33 pixmap_manager_ = ui::NativePixmapManager::Create(device_fd); |
| 34 } |
| 35 |
| 36 std::vector<ui::NativePixmapManager::Configuration> |
| 37 BrowserNativePixmapManager::GetSupportedNativePixmapConfigurations() const { |
| 38 return pixmap_manager_->GetSupportedNativePixmapConfigurations(); |
| 39 } |
| 40 |
| 41 } // namespace content |
OLD | NEW |