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

Unified Diff: ui/ozone/platform/cast/gl_surface_cast.cc

Issue 2801163002: Deletes NativeViewGLSurfaceEGL::Initialize(gfx::VSyncProvider). (Closed)
Patch Set: fixes DirectCompositionSurfaceTest Created 3 years, 8 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/init/gl_factory_win.cc ('k') | ui/ozone/platform/wayland/gl_surface_wayland.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/cast/gl_surface_cast.cc
diff --git a/ui/ozone/platform/cast/gl_surface_cast.cc b/ui/ozone/platform/cast/gl_surface_cast.cc
index 5f50ee8a690ac74cbccd3595897f8038940b5734..04d7d64c2d18559c00697697465b659e035d58f4 100644
--- a/ui/ozone/platform/cast/gl_surface_cast.cc
+++ b/ui/ozone/platform/cast/gl_surface_cast.cc
@@ -4,14 +4,26 @@
#include "ui/ozone/platform/cast/gl_surface_cast.h"
+#include "base/memory/ptr_util.h"
+#include "ui/gfx/vsync_provider.h"
#include "ui/ozone/common/egl_util.h"
#include "ui/ozone/platform/cast/gl_ozone_egl_cast.h"
+namespace {
+// Target fixed 30fps.
+// TODO(halliwell): We might need to customize this value on various devices
+// or make it dynamic that throttles framerate if device is overheating.
+const base::TimeDelta kVSyncInterval = base::TimeDelta::FromSeconds(2) / 59.9;
+} // namespace
+
namespace ui {
GLSurfaceCast::GLSurfaceCast(gfx::AcceleratedWidget widget,
GLOzoneEglCast* parent)
- : NativeViewGLSurfaceEGL(parent->GetNativeWindow()),
+ : NativeViewGLSurfaceEGL(
+ parent->GetNativeWindow(),
+ base::MakeUnique<gfx::FixedVSyncProvider>(base::TimeTicks(),
+ kVSyncInterval)),
widget_(widget),
parent_(parent),
supports_swap_buffer_with_bounds_(
« no previous file with comments | « ui/gl/init/gl_factory_win.cc ('k') | ui/ozone/platform/wayland/gl_surface_wayland.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698