Commit e2df857b authored by owenlin@chromium.org's avatar owenlin@chromium.org

rendering_helper: Release GL context before terminate a display.

Otherwise, we won't be able to initialize it again.

BUG=chrome-os-partner:29674
TEST=Run the unittest on nyan.

Review URL: https://codereview.chromium.org/339863002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277995 0039d316-1c4b-4281-b951-d872f2087c98
parent b8f0996b
......@@ -154,7 +154,7 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
#endif
gl_display_ = eglGetDisplay(native_display);
CHECK(gl_display_);
CHECK(eglInitialize(gl_display_, NULL, NULL)) << glGetError();
CHECK(eglInitialize(gl_display_, NULL, NULL)) << eglGetError();
static EGLint rgba8888[] = {
EGL_RED_SIZE, 8,
......@@ -385,6 +385,9 @@ void RenderingHelper::UnInitialize(base::WaitableEvent* done) {
glXDestroyContext(x_display_, gl_context_);
#else // EGL
CHECK(eglMakeCurrent(
gl_display_, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
<< eglGetError();
CHECK(eglDestroyContext(gl_display_, gl_context_));
CHECK(eglDestroySurface(gl_display_, gl_surface_));
CHECK(eglTerminate(gl_display_));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment