| Index: ui/ozone/public/ozone_platform.cc
|
| diff --git a/ui/ozone/public/ozone_platform.cc b/ui/ozone/public/ozone_platform.cc
|
| index b69bc28927d76d800321b2f58b2c26c66759d21d..8d94029ca421d6e27ae49470d710e05870d3d91c 100644
|
| --- a/ui/ozone/public/ozone_platform.cc
|
| +++ b/ui/ozone/public/ozone_platform.cc
|
| @@ -17,7 +17,7 @@ namespace {
|
|
|
| bool g_platform_initialized_ui = false;
|
| bool g_platform_initialized_gpu = false;
|
| -
|
| +bool g_platform_initialized_gpu_post_main_loop = false;
|
| }
|
|
|
| OzonePlatform::OzonePlatform() {
|
| @@ -25,6 +25,7 @@ OzonePlatform::OzonePlatform() {
|
| instance_ = this;
|
| g_platform_initialized_ui = false;
|
| g_platform_initialized_gpu = false;
|
| + g_platform_initialized_gpu_post_main_loop = false;
|
| }
|
|
|
| OzonePlatform::~OzonePlatform() {
|
| @@ -54,6 +55,18 @@ void OzonePlatform::InitializeForGPU() {
|
| }
|
|
|
| // static
|
| +void OzonePlatform::InitializeForGpuPostMainLoop() {
|
| + DCHECK(g_platform_initialized_gpu) << "InitializeForGPU needs to be called "
|
| + "before InitializeForGpuPostMainLoop";
|
| + if (!base::MessageLoop::current() ||
|
| + g_platform_initialized_gpu_post_main_loop)
|
| + return;
|
| + g_platform_initialized_gpu_post_main_loop = true;
|
| +
|
| + instance_->InitializeGpuPostMainLoop();
|
| +}
|
| +
|
| +// static
|
| OzonePlatform* OzonePlatform::GetInstance() {
|
| DCHECK(instance_) << "OzonePlatform is not initialized";
|
| return instance_;
|
|
|