1 /* 2 * Copyright 2017 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrSemaphoreOp_DEFINED 9 #define GrSemaphoreOp_DEFINED 10 11 #include "src/gpu/ops/GrOp.h" 12 13 #include "include/core/SkRefCnt.h" 14 #include "src/gpu/GrRenderTargetProxy.h" 15 #include "src/gpu/GrSemaphore.h" 16 17 class GrRecordingContext; 18 19 class GrSemaphoreOp : public GrOp { 20 public: 21 static std::unique_ptr<GrOp> MakeWait(GrRecordingContext*, 22 sk_sp<GrSemaphore>, 23 GrRenderTargetProxy*); 24 25 protected: GrSemaphoreOp(uint32_t classId,sk_sp<GrSemaphore> semaphore,GrRenderTargetProxy * proxy)26 GrSemaphoreOp(uint32_t classId, sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy) 27 : INHERITED(classId) 28 , fSemaphore(std::move(semaphore)) { 29 this->makeFullScreen(proxy); 30 } 31 32 sk_sp<GrSemaphore> fSemaphore; 33 34 private: onPrepare(GrOpFlushState *)35 void onPrepare(GrOpFlushState*) override {} 36 37 typedef GrOp INHERITED; 38 }; 39 40 #endif 41