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