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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 2188063002: Update vsync override in PostSubBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « 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 614ca675b5755ef399229f426acbe838fe377c89..2a0c9bb53bd682ab88e63a42f7e34eb2e108efeb 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -746,11 +746,7 @@ bool NativeViewGLSurfaceEGL::IsOffscreen() {
return false;
}
-gfx::SwapResult NativeViewGLSurfaceEGL::SwapBuffers() {
- TRACE_EVENT2("gpu", "NativeViewGLSurfaceEGL:RealSwapBuffers",
- "width", GetSize().width(),
- "height", GetSize().height());
-
+void NativeViewGLSurfaceEGL::UpdateSwapInterval() {
#if defined(OS_WIN)
if (swap_interval_ != 0) {
// This code is a simple way of enforcing that we only vsync if one surface
@@ -785,6 +781,14 @@ gfx::SwapResult NativeViewGLSurfaceEGL::SwapBuffers() {
swaps_this_generation_++;
}
#endif
+}
+
+gfx::SwapResult NativeViewGLSurfaceEGL::SwapBuffers() {
+ TRACE_EVENT2("gpu", "NativeViewGLSurfaceEGL:RealSwapBuffers",
+ "width", GetSize().width(),
+ "height", GetSize().height());
+
+ UpdateSwapInterval();
if (!CommitAndClearPendingOverlays()) {
DVLOG(1) << "Failed to commit pending overlay planes.";
@@ -871,6 +875,7 @@ gfx::SwapResult NativeViewGLSurfaceEGL::PostSubBuffer(int x,
int width,
int height) {
DCHECK(supports_post_sub_buffer_);
+ UpdateSwapInterval();
if (!CommitAndClearPendingOverlays()) {
DVLOG(1) << "Failed to commit pending overlay planes.";
return gfx::SwapResult::SWAP_FAILED;
« 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