Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: ui/ozone/public/native_pixmap_manager.cc

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NativePixmapManager is singleton Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "ui/ozone/public/native_pixmap_manager.h"
6
7 #include "base/command_line.h"
8 #include "base/logging.h"
9 #include "base/trace_event/trace_event.h"
10 #include "ui/ozone/platform_object.h"
11 #include "ui/ozone/platform_selection.h"
12 #include "ui/ozone/public/ozone_platform.h"
13 #include "ui/ozone/public/ozone_switches.h"
14
15 namespace ui {
16
17 namespace {
18
19 class StubNativePixmapManager : public NativePixmapManager {
20 public:
21 StubNativePixmapManager() {}
22 ~StubNativePixmapManager() override {}
23
24 void Initialize(const base::FileDescriptor& device_fd) override {}
25
26 std::vector<Configuration> GetSupportedNativePixmapConfigurations()
27 const override {
28 return std::vector<Configuration>();
29 }
30
31 private:
32 DISALLOW_COPY_AND_ASSIGN(StubNativePixmapManager);
33 };
34
35 NativePixmapManager* g_instance = NULL;
36
37 } // namespace
38
39 // static
40 NativePixmapManager* NativePixmapManager::GetInstance() {
41 DCHECK(g_instance);
42 return g_instance;
43 }
44
45 // static
46 void NativePixmapManager::SetInstance(NativePixmapManager* instance) {
47 DCHECK(!g_instance || !instance);
48 g_instance = instance;
49 }
50
51 // static
52 scoped_ptr<NativePixmapManager> NativePixmapManager::Create(
53 const base::FileDescriptor& device_fd) {
54 TRACE_EVENT1("ozone", "NativePixmapManager::Create", "platform",
55 GetOzonePlatformName());
56 scoped_ptr<NativePixmapManager> manager =
57 PlatformObject<NativePixmapManager>::Create();
58 manager->Initialize(device_fd);
59 return manager.Pass();
60 }
61
62 NativePixmapManager::NativePixmapManager() {
63 }
64
65 NativePixmapManager::~NativePixmapManager() {
66 }
67
68 NativePixmapManager* CreateStubNativePixmapManager() {
69 return new StubNativePixmapManager;
70 }
71
72 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698