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

Unified Diff: ui/gl/gl_context_egl.cc

Issue 693313002: Dont set SwapInterval with Surfaceless. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing Changes Created 6 years, 1 month 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 | « ui/gl/gl_context_egl.h ('k') | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_egl.cc
diff --git a/ui/gl/gl_context_egl.cc b/ui/gl/gl_context_egl.cc
index 2554f8c5b1d029277e541ab78a2f1ed1680a94b1..60ceece6109ddf0ec27b163cb60c41a4ae6d0eb4 100644
--- a/ui/gl/gl_context_egl.cc
+++ b/ui/gl/gl_context_egl.cc
@@ -29,7 +29,8 @@ GLContextEGL::GLContextEGL(GLShareGroup* share_group)
context_(NULL),
display_(NULL),
config_(NULL),
- unbind_fbo_on_makecurrent_(false) {
+ unbind_fbo_on_makecurrent_(false),
+ is_surfaceless_context_(false) {
}
bool GLContextEGL::Initialize(
@@ -74,6 +75,8 @@ bool GLContextEGL::Initialize(
return false;
}
+ is_surfaceless_context_ = compatible_surface->IsSurfaceless();
+
return true;
}
@@ -125,6 +128,7 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) {
return false;
}
+ is_surfaceless_context_ = surface->IsSurfaceless();
release_current.Cancel();
return true;
}
@@ -174,6 +178,12 @@ void* GLContextEGL::GetHandle() {
void GLContextEGL::SetSwapInterval(int interval) {
DCHECK(IsCurrent(NULL));
+
+ // This is a surfaceless context. eglSwapInterval doesn't take any effect in
+ // this case and will just return EGL_BAD_SURFACE.
+ if (is_surfaceless_context_)
piman 2014/11/03 19:43:13 Rather than stashing a bool, you can simply use GL
kalyank 2014/11/03 20:04:53 Didn't realize that, thanks. Will do that.
kalyank 2014/11/03 20:46:11 Done.
+ return;
+
if (!eglSwapInterval(display_, interval)) {
LOG(ERROR) << "eglSwapInterval failed with error "
<< GetLastEGLErrorString();
« no previous file with comments | « ui/gl/gl_context_egl.h ('k') | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698