aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrSemaphoreOp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ops/GrSemaphoreOp.cpp')
-rw-r--r--src/gpu/ops/GrSemaphoreOp.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/gpu/ops/GrSemaphoreOp.cpp b/src/gpu/ops/GrSemaphoreOp.cpp
index a6c9ac7214..fedf6b723a 100644
--- a/src/gpu/ops/GrSemaphoreOp.cpp
+++ b/src/gpu/ops/GrSemaphoreOp.cpp
@@ -7,16 +7,20 @@
#include "GrSemaphoreOp.h"
+#include "GrContext.h"
+#include "GrContextPriv.h"
#include "GrGpu.h"
+#include "GrMemoryPool.h"
#include "GrOpFlushState.h"
class GrSignalSemaphoreOp final : public GrSemaphoreOp {
public:
DEFINE_OP_CLASS_ID
- static std::unique_ptr<GrSignalSemaphoreOp> Make(sk_sp<GrSemaphore> semaphore,
- GrRenderTargetProxy* proxy,
- bool forceFlush) {
+ static std::unique_ptr<GrOp> Make(GrContext* context,
+ sk_sp<GrSemaphore> semaphore,
+ GrRenderTargetProxy* proxy,
+ bool forceFlush) {
return std::unique_ptr<GrSignalSemaphoreOp>(new GrSignalSemaphoreOp(std::move(semaphore),
proxy,
forceFlush));
@@ -25,6 +29,8 @@ public:
const char* name() const override { return "SignalSemaphore"; }
private:
+ friend class GrOpMemoryPool; // for ctor
+
explicit GrSignalSemaphoreOp(sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy,
bool forceFlush)
: INHERITED(ClassID(), std::move(semaphore), proxy), fForceFlush(forceFlush) {}
@@ -42,8 +48,9 @@ class GrWaitSemaphoreOp final : public GrSemaphoreOp {
public:
DEFINE_OP_CLASS_ID
- static std::unique_ptr<GrWaitSemaphoreOp> Make(sk_sp<GrSemaphore> semaphore,
- GrRenderTargetProxy* proxy) {
+ static std::unique_ptr<GrOp> Make(GrContext* context,
+ sk_sp<GrSemaphore> semaphore,
+ GrRenderTargetProxy* proxy) {
return std::unique_ptr<GrWaitSemaphoreOp>(new GrWaitSemaphoreOp(std::move(semaphore),
proxy));
}
@@ -51,6 +58,8 @@ public:
const char* name() const override { return "WaitSemaphore"; }
private:
+ friend class GrOpMemoryPool; // for ctor
+
explicit GrWaitSemaphoreOp(sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy)
: INHERITED(ClassID(), std::move(semaphore), proxy) {}
@@ -63,15 +72,17 @@ private:
////////////////////////////////////////////////////////////////////////////////
-std::unique_ptr<GrSemaphoreOp> GrSemaphoreOp::MakeSignal(sk_sp<GrSemaphore> semaphore,
- GrRenderTargetProxy* proxy,
- bool forceFlush) {
- return GrSignalSemaphoreOp::Make(std::move(semaphore), proxy, forceFlush);
+std::unique_ptr<GrOp> GrSemaphoreOp::MakeSignal(GrContext* context,
+ sk_sp<GrSemaphore> semaphore,
+ GrRenderTargetProxy* proxy,
+ bool forceFlush) {
+ return GrSignalSemaphoreOp::Make(context, std::move(semaphore), proxy, forceFlush);
}
-std::unique_ptr<GrSemaphoreOp> GrSemaphoreOp::MakeWait(sk_sp<GrSemaphore> semaphore,
- GrRenderTargetProxy* proxy) {
- return GrWaitSemaphoreOp::Make(std::move(semaphore), proxy);
+std::unique_ptr<GrOp> GrSemaphoreOp::MakeWait(GrContext* context,
+ sk_sp<GrSemaphore> semaphore,
+ GrRenderTargetProxy* proxy) {
+ return GrWaitSemaphoreOp::Make(context, std::move(semaphore), proxy);
}