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

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

Issue 712343003: Infrastructure for temportarily relinquishing GPU resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make callback optional. Other changes suggested by jbauman and spang Created 6 years, 1 month 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/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
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
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
OLDNEW
« ui/ozone/common/gpu/ozone_gpu_messages.h ('K') | « ui/ozone/public/ozone_platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698