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

Unified Diff: trunk/src/gpu/config/gpu_info_collector_android.cc

Issue 149953003: Revert 247793 "Ensure GL initialization only happens once, and p..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | « trunk/src/gpu/config/gpu_info_collector.cc ('k') | trunk/src/gpu/config/gpu_info_collector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/gpu/config/gpu_info_collector_android.cc
===================================================================
--- trunk/src/gpu/config/gpu_info_collector_android.cc (revision 247809)
+++ trunk/src/gpu/config/gpu_info_collector_android.cc (working copy)
@@ -65,19 +65,23 @@
// Chromium native code, but created by Android system itself.
DCHECK(!gfx::GLContext::GetCurrent());
- context_ = eglGetCurrentContext();
- display_ = eglGetCurrentDisplay();
- draw_surface_ = eglGetCurrentSurface(EGL_DRAW);
- read_surface_ = eglGetCurrentSurface(EGL_READ);
+ if (gfx::GLSurface::InitializeOneOff()) {
+ context_ = eglGetCurrentContext();
+ display_ = eglGetCurrentDisplay();
+ draw_surface_ = eglGetCurrentSurface(EGL_DRAW);
+ read_surface_ = eglGetCurrentSurface(EGL_READ);
+ }
}
ScopedRestoreNonOwnedEGLContext::~ScopedRestoreNonOwnedEGLContext() {
if (context_ == EGL_NO_CONTEXT || display_ == EGL_NO_DISPLAY ||
- draw_surface_ == EGL_NO_SURFACE || read_surface_ == EGL_NO_SURFACE)
+ draw_surface_ == EGL_NO_SURFACE || read_surface_ == EGL_NO_SURFACE) {
return;
+ }
- if (!eglMakeCurrent(display_, draw_surface_, read_surface_, context_))
+ if (!eglMakeCurrent(display_, draw_surface_, read_surface_, context_)) {
LOG(WARNING) << "Failed to restore EGL context";
+ }
}
}
« no previous file with comments | « trunk/src/gpu/config/gpu_info_collector.cc ('k') | trunk/src/gpu/config/gpu_info_collector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698