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

Unified Diff: gpu/config/gpu_info_collector_android.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: compile3 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 | « gpu/config/gpu_info_collector.cc ('k') | 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: gpu/config/gpu_info_collector_android.cc
diff --git a/gpu/config/gpu_info_collector_android.cc b/gpu/config/gpu_info_collector_android.cc
index 79428a1a62ce2ac556b90661a1f99f5d13ce5e83..03f357e956f701b30c7fc93a53efc0357b0468b1 100644
--- a/gpu/config/gpu_info_collector_android.cc
+++ b/gpu/config/gpu_info_collector_android.cc
@@ -65,23 +65,19 @@ ScopedRestoreNonOwnedEGLContext::ScopedRestoreNonOwnedEGLContext()
// Chromium native code, but created by Android system itself.
DCHECK(!gfx::GLContext::GetCurrent());
- if (gfx::GLSurface::InitializeOneOff()) {
- context_ = eglGetCurrentContext();
- display_ = eglGetCurrentDisplay();
- draw_surface_ = eglGetCurrentSurface(EGL_DRAW);
- read_surface_ = eglGetCurrentSurface(EGL_READ);
- }
+ 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 | « gpu/config/gpu_info_collector.cc ('k') | gpu/config/gpu_info_collector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698