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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/cast/gl_surface_cast.h" 5 #include "ui/ozone/platform/cast/gl_surface_cast.h"
6 6
7 #include "base/memory/ptr_util.h"
8 #include "ui/gfx/vsync_provider.h"
7 #include "ui/ozone/common/egl_util.h" 9 #include "ui/ozone/common/egl_util.h"
8 #include "ui/ozone/platform/cast/gl_ozone_egl_cast.h" 10 #include "ui/ozone/platform/cast/gl_ozone_egl_cast.h"
9 11
12 namespace {
13 // Target fixed 30fps.
14 // TODO(halliwell): We might need to customize this value on various devices
15 // or make it dynamic that throttles framerate if device is overheating.
16 const base::TimeDelta kVSyncInterval = base::TimeDelta::FromSeconds(2) / 59.9;
17 } // namespace
18
10 namespace ui { 19 namespace ui {
11 20
12 GLSurfaceCast::GLSurfaceCast(gfx::AcceleratedWidget widget, 21 GLSurfaceCast::GLSurfaceCast(gfx::AcceleratedWidget widget,
13 GLOzoneEglCast* parent) 22 GLOzoneEglCast* parent)
14 : NativeViewGLSurfaceEGL(parent->GetNativeWindow()), 23 : NativeViewGLSurfaceEGL(
24 parent->GetNativeWindow(),
25 base::MakeUnique<gfx::FixedVSyncProvider>(base::TimeTicks(),
26 kVSyncInterval)),
15 widget_(widget), 27 widget_(widget),
16 parent_(parent), 28 parent_(parent),
17 supports_swap_buffer_with_bounds_( 29 supports_swap_buffer_with_bounds_(
18 base::CommandLine::ForCurrentProcess()->HasSwitch( 30 base::CommandLine::ForCurrentProcess()->HasSwitch(
19 switches::kEnableSwapBuffersWithBounds)) { 31 switches::kEnableSwapBuffersWithBounds)) {
20 DCHECK(parent_); 32 DCHECK(parent_);
21 } 33 }
22 34
23 bool GLSurfaceCast::SupportsSwapBuffersWithBounds() { 35 bool GLSurfaceCast::SupportsSwapBuffersWithBounds() {
24 return supports_swap_buffer_with_bounds_; 36 return supports_swap_buffer_with_bounds_;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 101 }
90 return config_; 102 return config_;
91 } 103 }
92 104
93 GLSurfaceCast::~GLSurfaceCast() { 105 GLSurfaceCast::~GLSurfaceCast() {
94 Destroy(); 106 Destroy();
95 parent_->ChildDestroyed(); 107 parent_->ChildDestroyed();
96 } 108 }
97 109
98 } // namespace ui 110 } // namespace ui
OLDNEW
« 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