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: gpu/ipc/service/gpu_vsync_provider_win.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/gpu_vsync_provider_unittest_win.cc ('k') | gpu/ipc/service/gpu_vsync_provider_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_vsync_provider_win.h
diff --git a/gpu/ipc/service/gpu_vsync_provider_win.h b/gpu/ipc/service/gpu_vsync_provider_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..5db207068eeedc6a4db358675d6cbd5b006628ec
--- /dev/null
+++ b/gpu/ipc/service/gpu_vsync_provider_win.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_IPC_SERVICE_GPU_VSYNC_PROVIDER_WIN_H_
+#define GPU_IPC_SERVICE_GPU_VSYNC_PROVIDER_WIN_H_
+
+#include <memory>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/synchronization/lock.h"
+#include "base/time/time.h"
+#include "gpu/gpu_export.h"
+#include "gpu/ipc/common/surface_handle.h"
+#include "gpu/ipc/service/image_transport_surface_delegate.h"
+#include "ui/gfx/vsync_provider.h"
+
+namespace gpu {
+
+class GpuVSyncWorker;
+class GpuVSyncMessageFilter;
+
+class GPU_EXPORT GpuVSyncProviderWin : public gfx::VSyncProvider {
+ public:
+ GpuVSyncProviderWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate,
+ SurfaceHandle surface_handle);
+ ~GpuVSyncProviderWin() override;
+
+ // This class ignores this method and updates VSync directly via a
+ // worker thread IPC call.
+ void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
+
+ private:
+ void OnVSync(base::TimeTicks timestamp, base::TimeDelta interval);
+
+ // VSync worker that waits for VSync events on worker thread.
+ scoped_refptr<GpuVSyncWorker> vsync_worker_;
+ // Message filter to send/receive IPC messages.
+ scoped_refptr<GpuVSyncMessageFilter> message_filter_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuVSyncProviderWin);
+};
+
+} // namespace gpu
+
+#endif // GPU_IPC_SERVICE_GPU_VSYNC_PROVIDER_WIN_H_
« no previous file with comments | « gpu/ipc/service/gpu_vsync_provider_unittest_win.cc ('k') | gpu/ipc/service/gpu_vsync_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698