OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2015 Google Inc. | 2 * Copyright 2016 Google Inc. |
4 * | 3 * |
5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 #ifndef SkGpuFenceSync_DEFINED | 7 |
9 #define SkGpuFenceSync_DEFINED | 8 #ifndef FenceSync_DEFINED |
| 9 #define FenceSync_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 typedef void* SkPlatformGpuFence; | 13 namespace sk_gpu_test { |
14 constexpr static SkPlatformGpuFence kInvalidPlatformGpuFence = nullptr; | 14 |
| 15 using PlatformFence = intptr_t; |
| 16 static constexpr PlatformFence kInvalidPlatformFence = 0; |
15 | 17 |
16 /* | 18 /* |
17 * This class provides an interface to interact with fence syncs. A fence sync i
s an object that the | 19 * This class provides an interface to interact with fence syncs. A fence sync i
s an object that the |
18 * client can insert into the GPU command stream, and then at any future time, w
ait until all | 20 * client can insert into the GPU command stream, and then at any future time, w
ait until all |
19 * commands that were issued before the fence have completed. | 21 * commands that were issued before the fence have completed. |
20 */ | 22 */ |
21 class SkGpuFenceSync { | 23 class FenceSync { |
22 public: | 24 public: |
23 virtual SkPlatformGpuFence SK_WARN_UNUSED_RESULT insertFence() const = 0; | 25 virtual PlatformFence SK_WARN_UNUSED_RESULT insertFence() const = 0; |
24 virtual bool waitFence(SkPlatformGpuFence) const = 0; | 26 virtual bool waitFence(PlatformFence) const = 0; |
25 virtual void deleteFence(SkPlatformGpuFence) const = 0; | 27 virtual void deleteFence(PlatformFence) const = 0; |
26 | 28 |
27 virtual ~SkGpuFenceSync() {} | 29 virtual ~FenceSync() {} |
28 }; | 30 }; |
29 | 31 |
| 32 } |
| 33 |
30 #endif | 34 #endif |
OLD | NEW |