| Index: ui/ozone/public/native_pixmap_manager.cc
|
| diff --git a/ui/ozone/public/native_pixmap_manager.cc b/ui/ozone/public/native_pixmap_manager.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9a9fdb4ade7bdaf0c210935b22bbc7070a0cdb6d
|
| --- /dev/null
|
| +++ b/ui/ozone/public/native_pixmap_manager.cc
|
| @@ -0,0 +1,72 @@
|
| +// 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 "ui/ozone/public/native_pixmap_manager.h"
|
| +
|
| +#include "base/command_line.h"
|
| +#include "base/logging.h"
|
| +#include "base/trace_event/trace_event.h"
|
| +#include "ui/ozone/platform_object.h"
|
| +#include "ui/ozone/platform_selection.h"
|
| +#include "ui/ozone/public/ozone_platform.h"
|
| +#include "ui/ozone/public/ozone_switches.h"
|
| +
|
| +namespace ui {
|
| +
|
| +namespace {
|
| +
|
| +class StubNativePixmapManager : public NativePixmapManager {
|
| + public:
|
| + StubNativePixmapManager() {}
|
| + ~StubNativePixmapManager() override {}
|
| +
|
| + void Initialize(const base::FileDescriptor& device_fd) override {}
|
| +
|
| + std::vector<Configuration> GetSupportedNativePixmapConfigurations()
|
| + const override {
|
| + return std::vector<Configuration>();
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(StubNativePixmapManager);
|
| +};
|
| +
|
| +NativePixmapManager* g_instance = NULL;
|
| +
|
| +} // namespace
|
| +
|
| +// static
|
| +NativePixmapManager* NativePixmapManager::GetInstance() {
|
| + DCHECK(g_instance);
|
| + return g_instance;
|
| +}
|
| +
|
| +// static
|
| +void NativePixmapManager::SetInstance(NativePixmapManager* instance) {
|
| + DCHECK(!g_instance || !instance);
|
| + g_instance = instance;
|
| +}
|
| +
|
| +// static
|
| +scoped_ptr<NativePixmapManager> NativePixmapManager::Create(
|
| + const base::FileDescriptor& device_fd) {
|
| + TRACE_EVENT1("ozone", "NativePixmapManager::Create", "platform",
|
| + GetOzonePlatformName());
|
| + scoped_ptr<NativePixmapManager> manager =
|
| + PlatformObject<NativePixmapManager>::Create();
|
| + manager->Initialize(device_fd);
|
| + return manager.Pass();
|
| +}
|
| +
|
| +NativePixmapManager::NativePixmapManager() {
|
| +}
|
| +
|
| +NativePixmapManager::~NativePixmapManager() {
|
| +}
|
| +
|
| +NativePixmapManager* CreateStubNativePixmapManager() {
|
| + return new StubNativePixmapManager;
|
| +}
|
| +
|
| +} // namespace ui
|
|
|