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

Side by Side Diff: ui/ozone/public/ozone_platform.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: Introduce NativePixmapClient Created 5 years, 6 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "ui/events/devices/device_data_manager.h" 8 #include "ui/events/devices/device_data_manager.h"
9 #include "ui/ozone/platform_object.h" 9 #include "ui/ozone/platform_object.h"
10 #include "ui/ozone/platform_selection.h" 10 #include "ui/ozone/platform_selection.h"
11 #include "ui/ozone/public/native_pixmap_client.h"
11 #include "ui/ozone/public/ozone_platform.h" 12 #include "ui/ozone/public/ozone_platform.h"
12 #include "ui/ozone/public/ozone_switches.h" 13 #include "ui/ozone/public/ozone_switches.h"
13 14
14 namespace ui { 15 namespace ui {
15 16
16 namespace { 17 namespace {
17 18
18 bool g_platform_initialized_ui = false; 19 bool g_platform_initialized_ui = false;
19 bool g_platform_initialized_gpu = false; 20 bool g_platform_initialized_gpu = false;
20 21
(...skipping 14 matching lines...) Expand all
35 // static 36 // static
36 void OzonePlatform::InitializeForUI() { 37 void OzonePlatform::InitializeForUI() {
37 CreateInstance(); 38 CreateInstance();
38 if (g_platform_initialized_ui) 39 if (g_platform_initialized_ui)
39 return; 40 return;
40 g_platform_initialized_ui = true; 41 g_platform_initialized_ui = true;
41 instance_->InitializeUI(); 42 instance_->InitializeUI();
42 // This is deliberately created after initializing so that the platform can 43 // This is deliberately created after initializing so that the platform can
43 // create its own version of DDM. 44 // create its own version of DDM.
44 DeviceDataManager::CreateInstance(); 45 DeviceDataManager::CreateInstance();
46
47 NativePixmapClient::InitializeIfNeeded();
dshwang 2015/06/03 14:11:51 Browser process always initializes it unlike Rende
spang 2015/06/05 19:21:54 Why does the browser need it? Is there a case wher
reveman 2015/06/05 20:26:07 The UI compositor.
45 } 48 }
46 49
47 // static 50 // static
48 void OzonePlatform::InitializeForGPU() { 51 void OzonePlatform::InitializeForGPU() {
49 CreateInstance(); 52 CreateInstance();
50 if (g_platform_initialized_gpu) 53 if (g_platform_initialized_gpu)
51 return; 54 return;
52 g_platform_initialized_gpu = true; 55 g_platform_initialized_gpu = true;
53 instance_->InitializeGPU(); 56 instance_->InitializeGPU();
54 } 57 }
(...skipping 17 matching lines...) Expand all
72 // TODO(spang): Currently need to leak this object. 75 // TODO(spang): Currently need to leak this object.
73 OzonePlatform* pl = platform.release(); 76 OzonePlatform* pl = platform.release();
74 DCHECK_EQ(instance_, pl); 77 DCHECK_EQ(instance_, pl);
75 } 78 }
76 } 79 }
77 80
78 // static 81 // static
79 OzonePlatform* OzonePlatform::instance_; 82 OzonePlatform* OzonePlatform::instance_;
80 83
81 } // namespace ui 84 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698