diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index 4e1ff9f41cd6f9419abfb419d986b37eb74d23e0..83586b403059305dd5a35ee700c368f4a718af97 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -11,35 +11,23 @@ namespace shell { -static fml::RefPtr GlobalResourceLoadingContext() { - // AndroidSurfaceGL instances are only ever created on the platform thread. So - // there is no need to lock here. - - static fml::RefPtr global_context; - - if (global_context) { - return global_context; - } - +static fml::RefPtr CreateResourceLoadingContext() { auto environment = fml::MakeRefCounted(); - if (!environment->IsValid()) { return nullptr; } auto context = fml::MakeRefCounted(environment); - if (!context->IsValid()) { return nullptr; } - global_context = context; - return global_context; + return context; } AndroidSurfaceGL::AndroidSurfaceGL() { // Acquire the offscreen context. - offscreen_context_ = GlobalResourceLoadingContext(); + offscreen_context_ = CreateResourceLoadingContext(); if (!offscreen_context_ || !offscreen_context_->IsValid()) { offscreen_context_ = nullptr;