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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 710393003: Revert of Allow Windows to use system Vsync for a single window each swap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_surface_egl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index c34ca0e70e7a25396a82cd9310a90c2ef0630cd6..8c08ff4981c19a04101deca89b10581bd259577a 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -53,8 +53,6 @@
using ui::GetLastEGLErrorString;
namespace gfx {
-
-unsigned int NativeViewGLSurfaceEGL::current_swap_generation_ = 0;
namespace {
@@ -288,9 +286,7 @@
surface_(NULL),
supports_post_sub_buffer_(false),
config_(NULL),
- size_(1, 1),
- swap_interval_(1),
- swap_generation_(0) {
+ size_(1, 1) {
#if defined(OS_ANDROID)
if (window)
ANativeWindow_acquire(window);
@@ -454,36 +450,11 @@
"width", GetSize().width(),
"height", GetSize().height());
-#if defined(OS_WIN)
- bool force_no_vsync = false;
- if (swap_interval_ != 0) {
- // This code is a simple way of enforcing that only one surface actually
- // vsyncs per frame. This provides single window cases a stable refresh
- // while allowing multi-window cases to not slow down due to multiple syncs
- // on a single thread. A better way to fix this problem would be to have
- // each surface present on its own thread.
- if (current_swap_generation_ == swap_generation_) {
- current_swap_generation_++;
- } else {
- force_no_vsync = true;
- eglSwapInterval(GetDisplay(), 0);
- }
-
- swap_generation_ = current_swap_generation_;
- }
-#endif
-
if (!eglSwapBuffers(GetDisplay(), surface_)) {
DVLOG(1) << "eglSwapBuffers failed with error "
<< GetLastEGLErrorString();
return false;
}
-
-#if defined(OS_WIN)
- if (force_no_vsync) {
- eglSwapInterval(GetDisplay(), swap_interval_);
- }
-#endif
return true;
}
@@ -557,10 +528,6 @@
VSyncProvider* NativeViewGLSurfaceEGL::GetVSyncProvider() {
return vsync_provider_.get();
-}
-
-void NativeViewGLSurfaceEGL::SetSwapInterval(int interval) {
- swap_interval_ = interval;
}
NativeViewGLSurfaceEGL::~NativeViewGLSurfaceEGL() {
« no previous file with comments | « ui/gl/gl_surface_egl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698