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 "GrSemaphore.h" 14#include "SkRefCnt.h" 15 16class GrSemaphoreOp : public GrOp { 17public: 18 static std::unique_ptr<GrSemaphoreOp> MakeSignal(sk_sp<GrSemaphore> semaphore); 19 20 static std::unique_ptr<GrSemaphoreOp> MakeWait(sk_sp<GrSemaphore> semaphore); 21 22protected: 23 GrSemaphoreOp(uint32_t classId, sk_sp<GrSemaphore> semaphore) 24 : INHERITED(classId), fSemaphore(std::move(semaphore)) {} 25 26 sk_sp<GrSemaphore> fSemaphore; 27 28private: 29 bool onCombineIfPossible(GrOp* that, const GrCaps& caps) override { return false; } 30 void onPrepare(GrOpFlushState*) override {} 31 32 typedef GrOp INHERITED; 33}; 34 35#endif 36