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/test/test_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 TestNativePixmapManagerTrait |
| 13 : public DefaultSingletonTraits<TestNativePixmapManager> { |
| 14 static TestNativePixmapManager* New() { |
| 15 TestNativePixmapManager* manager = new TestNativePixmapManager(); |
| 16 manager->Initialize(base::FileDescriptor()); |
| 17 return manager; |
| 18 } |
| 19 }; |
| 20 |
| 21 // static |
| 22 TestNativePixmapManager* TestNativePixmapManager::GetInstance() { |
| 23 return Singleton<TestNativePixmapManager, |
| 24 TestNativePixmapManagerTrait>::get(); |
| 25 } |
| 26 |
| 27 TestNativePixmapManager::TestNativePixmapManager() {} |
| 28 |
| 29 TestNativePixmapManager::~TestNativePixmapManager() {} |
| 30 |
| 31 void TestNativePixmapManager::Initialize( |
| 32 const base::FileDescriptor& device_fd) { |
| 33 pixmap_manager_ = ui::NativePixmapManager::Create(device_fd); |
| 34 } |
| 35 |
| 36 std::vector<ui::NativePixmapManager::Configuration> |
| 37 TestNativePixmapManager::GetSupportedNativePixmapConfigurations() const { |
| 38 return pixmap_manager_->GetSupportedNativePixmapConfigurations(); |
| 39 } |
| 40 |
| 41 } // namespace content |
OLD | NEW |