| OLD | NEW |
| 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 #ifndef GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_ | 5 #ifndef GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_ |
| 6 #define GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_ | 6 #define GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_ |
| 7 | 7 |
| 8 #include "gpu/gpu_export.h" | 8 #include "gpu/gpu_export.h" |
| 9 #include "ui/gfx/gpu_fence.h" | 9 #include "ui/gfx/gpu_fence.h" |
| 10 #include "ui/gfx/shared_event.h" | |
| 11 | 10 |
| 12 namespace gpu { | 11 namespace gpu { |
| 13 | 12 |
| 14 // Provides common implementation of a GPU fence. | 13 // Provides common implementation of a GPU fence. |
| 15 class GPU_EXPORT GpuFenceImpl : public gfx::GpuFence { | 14 class GPU_EXPORT GpuFenceImpl : public gfx::GpuFence { |
| 16 public: | 15 public: |
| 17 GpuFenceImpl(); | 16 GpuFenceImpl(); |
| 18 explicit GpuFenceImpl(const gfx::GpuFenceHandle& handle); | |
| 19 ~GpuFenceImpl() override; | 17 ~GpuFenceImpl() override; |
| 20 | 18 |
| 21 static gfx::GpuFenceHandle CreateForChildProcess( | 19 static gfx::GpuFenceHandle CreateForChildProcess( |
| 22 base::ProcessHandle child_process); | 20 base::ProcessHandle child_process); |
| 23 | 21 |
| 22 static std::unique_ptr<GpuFenceImpl> CreateFromHandle( |
| 23 const gfx::GpuFenceHandle& handle); |
| 24 |
| 24 // Type-checking upcast routine. Returns an NULL on failure. | 25 // Type-checking upcast routine. Returns an NULL on failure. |
| 25 static GpuFenceImpl* FromClientFence(ClientFence fence); | 26 static GpuFenceImpl* FromClientFence(ClientFence fence); |
| 26 | 27 |
| 27 // Overridden from gfx::GpuFence: | 28 // Overridden from gfx::GpuFence: |
| 28 bool IsSignaled() override; | 29 bool IsSignaled() override; |
| 29 bool Wait(const base::TimeDelta& max_time) override; | 30 bool Wait(const base::TimeDelta& max_time) override; |
| 30 void Reset() override; | 31 void Reset() override; |
| 31 gfx::GpuFenceHandle GetHandle() const override; | |
| 32 ClientFence AsClientFence() override; | 32 ClientFence AsClientFence() override; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 gfx::SharedEvent shared_event_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(GpuFenceImpl); | 35 DISALLOW_COPY_AND_ASSIGN(GpuFenceImpl); |
| 38 }; | 36 }; |
| 39 | 37 |
| 40 } // namespace gpu | 38 } // namespace gpu |
| 41 | 39 |
| 42 #endif // GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_ | 40 #endif // GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_ |
| OLD | NEW |