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

Unified Diff: ui/gl/gl_context_cgl.cc

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_context.cc ('k') | ui/gl/gl_mock_autogen_gl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_cgl.cc
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
index d4bc7805fc6d3156d90889ab0f9b7289fd0ba39c..102407c4d58da6e3df624482126b227785e534ae 100644
--- a/ui/gl/gl_context_cgl.cc
+++ b/ui/gl/gl_context_cgl.cc
@@ -122,12 +122,15 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface,
void GLContextCGL::Destroy() {
if (discrete_pixelformat_) {
- // Delay releasing the pixel format for 10 seconds to reduce the number of
- // unnecessary GPU switches.
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&CGLReleasePixelFormat, discrete_pixelformat_),
- base::TimeDelta::FromSeconds(10));
+ if (base::MessageLoop::current() != NULL) {
+ // Delay releasing the pixel format for 10 seconds to reduce the number of
+ // unnecessary GPU switches.
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&CGLReleasePixelFormat, discrete_pixelformat_),
+ base::TimeDelta::FromSeconds(10));
+ } else {
+ CGLReleasePixelFormat(discrete_pixelformat_);
+ }
discrete_pixelformat_ = NULL;
}
if (context_) {
« no previous file with comments | « ui/gl/gl_context.cc ('k') | ui/gl/gl_mock_autogen_gl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698