|
13 | 13 | #include "GrMemoryPool.h" |
14 | 14 | #include "GrOpFlushState.h" |
15 | 15 |
|
16 | | -class GrSignalSemaphoreOp final : public GrSemaphoreOp { |
17 | | -public: |
18 | | - DEFINE_OP_CLASS_ID |
19 | | - |
20 | | - static std::unique_ptr<GrOp> Make(GrContext* context, |
21 | | - sk_sp<GrSemaphore> semaphore, |
22 | | - GrRenderTargetProxy* proxy, |
23 | | - bool forceFlush) { |
24 | | - GrOpMemoryPool* pool = context->contextPriv().opMemoryPool(); |
25 | | - |
26 | | - return pool->allocate<GrSignalSemaphoreOp>(std::move(semaphore), proxy, forceFlush); |
27 | | - } |
28 | | - |
29 | | - const char* name() const override { return "SignalSemaphore"; } |
30 | | - |
31 | | -private: |
32 | | - friend class GrOpMemoryPool; // for ctor |
33 | | - |
34 | | - explicit GrSignalSemaphoreOp(sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy, |
35 | | - bool forceFlush) |
36 | | - : INHERITED(ClassID(), std::move(semaphore), proxy), fForceFlush(forceFlush) {} |
37 | | - |
38 | | - void onExecute(GrOpFlushState* state, const SkRect& chainBounds) override { |
39 | | - state->gpu()->insertSemaphore(fSemaphore, fForceFlush); |
40 | | - } |
41 | | - |
42 | | - bool fForceFlush; |
43 | | - |
44 | | - typedef GrSemaphoreOp INHERITED; |
45 | | -}; |
46 | | - |
47 | 16 | class GrWaitSemaphoreOp final : public GrSemaphoreOp { |
48 | 17 | public: |
49 | 18 | DEFINE_OP_CLASS_ID |
@@ -73,13 +42,6 @@ class GrWaitSemaphoreOp final : public GrSemaphoreOp { |
73 | 42 |
|
74 | 43 | //////////////////////////////////////////////////////////////////////////////// |
75 | 44 |
|
76 | | -std::unique_ptr<GrOp> GrSemaphoreOp::MakeSignal(GrContext* context, |
77 | | - sk_sp<GrSemaphore> semaphore, |
78 | | - GrRenderTargetProxy* proxy, |
79 | | - bool forceFlush) { |
80 | | - return GrSignalSemaphoreOp::Make(context, std::move(semaphore), proxy, forceFlush); |
81 | | -} |
82 | | - |
83 | 45 | std::unique_ptr<GrOp> GrSemaphoreOp::MakeWait(GrContext* context, |
84 | 46 | sk_sp<GrSemaphore> semaphore, |
85 | 47 | GrRenderTargetProxy* proxy) { |
|
0 commit comments