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

Unified Diff: gpu/command_buffer/service/gpu_scheduler.cc

Issue 6987025: Apply setInterval to new surface-context pairs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add logging Created 9 years, 7 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 | « no previous file | ui/gfx/gl/gl_context_glx.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_scheduler.cc
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index d8a047c598c3dc99ae95df2ef8eecc757d79854a..4c547738e0f3434cd74285338e25771213e39faa 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -5,12 +5,14 @@
#include "gpu/command_buffer/service/gpu_scheduler.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/debug/trace_event.h"
#include "base/message_loop.h"
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_surface.h"
+#include "ui/gfx/gl/gl_switches.h"
using ::base::SharedMemory;
@@ -66,6 +68,16 @@ bool GpuScheduler::InitializeCommon(
if (!context->MakeCurrent(surface))
return false;
+#if !defined(OS_MACOSX)
+ // Set up swap interval for onscreen contexts.
+ if (!surface->IsOffscreen()) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpuVsync))
+ context->SetSwapInterval(0);
+ else
+ context->SetSwapInterval(1);
+ }
+#endif
+
// Do not limit to a certain number of commands before scheduling another
// update when rendering onscreen.
if (!surface->IsOffscreen())
« no previous file with comments | « no previous file | ui/gfx/gl/gl_context_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698