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 "GrOp.h" 12 13 #include "GrRenderTargetProxy.h" 14 #include "GrSemaphore.h" 15 #include "SkRefCnt.h" 16 17 class GrSemaphoreOp : public GrOp { 18 public: 19 static std::unique_ptr<GrOp> MakeWait(GrContext*, 20 sk_sp<GrSemaphore>, 21 GrRenderTargetProxy*); 22 23 protected: GrSemaphoreOp(uint32_t classId,sk_sp<GrSemaphore> semaphore,GrRenderTargetProxy * proxy)24 GrSemaphoreOp(uint32_t classId, sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy) 25 : INHERITED(classId), fSemaphore(std::move(semaphore)) { 26 this->makeFullScreen(proxy); 27 } 28 29 sk_sp<GrSemaphore> fSemaphore; 30 31 private: onPrepare(GrOpFlushState *)32 void onPrepare(GrOpFlushState*) override {} 33 34 typedef GrOp INHERITED; 35 }; 36 37 #endif 38