Skip to content

Instantly share code, notes, and snippets.

@jjgod
Created December 29, 2014 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjgod/e84ef4059c2a1ad87a4f to your computer and use it in GitHub Desktop.
Save jjgod/e84ef4059c2a1ad87a4f to your computer and use it in GitHub Desktop.
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