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

Side by Side Diff: gpu/ipc/service/gpu_vsync_provider.h

Issue 2681033011: Changed GpuVSyncProvider to implement gfx::VSyncProvider (Closed)
Patch Set: Addressed CR feedback Created 3 years, 10 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 | « gpu/ipc/service/gpu_command_buffer_stub.cc ('k') | gpu/ipc/service/gpu_vsync_provider_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_IPC_SERVICE_GPU_VSYNC_PROVIDER_H_
6 #define GPU_IPC_SERVICE_GPU_VSYNC_PROVIDER_H_
7
8 #include <memory>
9
10 #include "base/callback.h"
11 #include "base/time/time.h"
12 #include "gpu/gpu_export.h"
13 #include "gpu/ipc/common/surface_handle.h"
14
15 namespace gpu {
16
17 class GpuVSyncWorker;
18
19 // Implements waiting for VSync signal on background thread.
20 class GPU_EXPORT GpuVSyncProvider {
21 public:
22 // Once VSync is enabled, this callback is repeatedly invoked on every VSync.
23 // The call is made on background thread to avoid increased latency due to
24 // serializing callback invocation with other GPU tasks. The code that
25 // implements the callback function is expected to handle that.
26 using VSyncCallback = base::Callback<void(base::TimeTicks timestamp)>;
27
28 ~GpuVSyncProvider();
29
30 static std::unique_ptr<GpuVSyncProvider> Create(const VSyncCallback& callback,
31 SurfaceHandle surface_handle);
32
33 // Enable or disable VSync production.
34 void EnableVSync(bool enabled);
35
36 private:
37 #if defined(OS_WIN)
38 GpuVSyncProvider(const VSyncCallback& callback, SurfaceHandle surface_handle);
39
40 std::unique_ptr<GpuVSyncWorker> vsync_worker_;
41 #endif // defined(OS_WIN)
42
43 DISALLOW_COPY_AND_ASSIGN(GpuVSyncProvider);
44 };
45
46 } // namespace gpu
47
48 #endif // GPU_IPC_SERVICE_GPU_VSYNC_PROVIDER_H_
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.cc ('k') | gpu/ipc/service/gpu_vsync_provider_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698