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