| Index: content/child/child_client_native_pixmap_manager_ozone.cc
|
| diff --git a/content/child/child_client_native_pixmap_manager_ozone.cc b/content/child/child_client_native_pixmap_manager_ozone.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3dd7c4137477febbb7b8bb5e23484dcdc93a99f4
|
| --- /dev/null
|
| +++ b/content/child/child_client_native_pixmap_manager_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_manager_ozone.h"
|
| +
|
| +#include "base/file_descriptor_posix.h"
|
| +#include "base/memory/singleton.h"
|
| +
|
| +namespace content {
|
| +
|
| +struct ChildClientNativePixmapManagerTrait
|
| + : public DefaultSingletonTraits<ChildClientNativePixmapManager> {
|
| + static ChildClientNativePixmapManager* New() {
|
| + ChildClientNativePixmapManager* manager =
|
| + new ChildClientNativePixmapManager();
|
| + return manager;
|
| + }
|
| +};
|
| +
|
| +// static
|
| +ChildClientNativePixmapManager* ChildClientNativePixmapManager::GetInstance() {
|
| + return Singleton<ChildClientNativePixmapManager,
|
| + ChildClientNativePixmapManagerTrait>::get();
|
| +}
|
| +
|
| +ChildClientNativePixmapManager::ChildClientNativePixmapManager() {}
|
| +
|
| +ChildClientNativePixmapManager::~ChildClientNativePixmapManager() {}
|
| +
|
| +void ChildClientNativePixmapManager::Initialize(
|
| + const base::FileDescriptor& virtual_device) {
|
| + pixmap_manager_ = ui::ClientNativePixmapManager::Create(virtual_device);
|
| +}
|
| +
|
| +std::vector<ui::ClientNativePixmapManager::Configuration>
|
| +ChildClientNativePixmapManager::GetSupportedConfigurations() const {
|
| + return pixmap_manager_->GetSupportedConfigurations();
|
| +}
|
| +
|
| +scoped_ptr<ui::ClientNativePixmap>
|
| +ChildClientNativePixmapManager::ImportClientNativePixmap(
|
| + base::FileDescriptor handle,
|
| + gfx::Size size,
|
| + ui::NativePixmapFormat format,
|
| + ui::NativePixmapUsage usage) {
|
| + return pixmap_manager_->ImportClientNativePixmap(handle, size, format, usage);
|
| +}
|
| +
|
| +} // namespace content
|
|
|