OLD | NEW |
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/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
7 #include "base/logging.h" | 7 #include "base/logging.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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 instance_ = this; | 25 instance_ = this; |
26 g_platform_initialized_ui = false; | 26 g_platform_initialized_ui = false; |
27 g_platform_initialized_gpu = false; | 27 g_platform_initialized_gpu = false; |
28 } | 28 } |
29 | 29 |
30 OzonePlatform::~OzonePlatform() { | 30 OzonePlatform::~OzonePlatform() { |
31 DCHECK_EQ(instance_, this); | 31 DCHECK_EQ(instance_, this); |
32 instance_ = NULL; | 32 instance_ = NULL; |
33 } | 33 } |
34 | 34 |
| 35 void OzonePlatform::RelinquishGpuResources(base::Closure callback) { |
| 36 callback.Run(); |
| 37 } |
| 38 |
35 // static | 39 // static |
36 void OzonePlatform::InitializeForUI() { | 40 void OzonePlatform::InitializeForUI() { |
37 CreateInstance(); | 41 CreateInstance(); |
38 if (g_platform_initialized_ui) | 42 if (g_platform_initialized_ui) |
39 return; | 43 return; |
40 g_platform_initialized_ui = true; | 44 g_platform_initialized_ui = true; |
41 instance_->InitializeUI(); | 45 instance_->InitializeUI(); |
42 // This is deliberately created after initializing so that the platform can | 46 // This is deliberately created after initializing so that the platform can |
43 // create its own version of DDM. | 47 // create its own version of DDM. |
44 DeviceDataManager::CreateInstance(); | 48 DeviceDataManager::CreateInstance(); |
(...skipping 27 matching lines...) Expand all Loading... |
72 // TODO(spang): Currently need to leak this object. | 76 // TODO(spang): Currently need to leak this object. |
73 OzonePlatform* pl = platform.release(); | 77 OzonePlatform* pl = platform.release(); |
74 DCHECK_EQ(instance_, pl); | 78 DCHECK_EQ(instance_, pl); |
75 } | 79 } |
76 } | 80 } |
77 | 81 |
78 // static | 82 // static |
79 OzonePlatform* OzonePlatform::instance_; | 83 OzonePlatform* OzonePlatform::instance_; |
80 | 84 |
81 } // namespace ui | 85 } // namespace ui |
OLD | NEW |