Created
December 29, 2014 16:33
-
-
Save jjgod/e84ef4059c2a1ad87a4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc | |
index 689b936..292e9bf 100644 | |
--- a/ui/gl/gl_context_cgl.cc | |
+++ b/ui/gl/gl_context_cgl.cc | |
@@ -120,17 +120,23 @@ bool GLContextCGL::Initialize(GLSurface* compatible_surface, | |
return true; | |
} | |
+void ReleaseCGLPixelFormat(CGLPixelFormatObj fmt) { | |
+ LOG(INFO) << "CGLReleasePixelFormat: " << CGLGetPixelFormatRetainCount(fmt); | |
+ CGLReleasePixelFormat(fmt); | |
+} | |
+ | |
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::Bind(&ReleaseCGLPixelFormat, discrete_pixelformat_), | |
base::TimeDelta::FromSeconds(10)); | |
discrete_pixelformat_ = NULL; | |
} | |
if (context_) { | |
+ LOG(INFO) << "context: " << CGLGetContextRetainCount(static_cast<CGLContextObj>(context_)); | |
CGLDestroyContext(static_cast<CGLContextObj>(context_)); | |
context_ = NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment