diff options
author | Greg Daniel <egdaniel@google.com> | 2017-03-01 17:01:09 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-02 01:14:01 +0000 |
commit | 6be35238855dbbc7575e78d6723936293a4b38e6 (patch) | |
tree | 10fda73811eaa7a584f0b0551803d8b078196631 /src/gpu/GrSemaphore.h | |
parent | bb7dd4470b7e350ce5639633eae95b8209c26d52 (diff) |
Add support for Semaphores (gpu waiting on gpu) in Ganesh
BUG=skia:
Change-Id: I4324b65bc50a3dfd90372459899870d5f1952fdc
Reviewed-on: https://skia-review.googlesource.com/9120
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrSemaphore.h')
-rw-r--r-- | src/gpu/GrSemaphore.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gpu/GrSemaphore.h b/src/gpu/GrSemaphore.h new file mode 100644 index 0000000000..bdeff09ec2 --- /dev/null +++ b/src/gpu/GrSemaphore.h @@ -0,0 +1,29 @@ +/* + * Copyright 2017 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrSemaphore_DEFINED +#define GrSemaphore_DEFINED + +#include "SkRefCnt.h" + +class GrGpu; + +class GrSemaphore : public SkRefCnt { +public: + // This function should only be used in the case of exporting and importing a GrSemaphore object + // from one GrContext to another. When exporting, the GrSemaphore should be set to a null GrGpu, + // and when importing it should be set to the GrGpu of the current context. Once exported, a + // GrSemaphore should not be used with its old context. + void resetGpu(const GrGpu* gpu) { fGpu = gpu; } + +protected: + explicit GrSemaphore(const GrGpu* gpu) : fGpu(gpu) {} + + const GrGpu* fGpu; +}; + +#endif |