blob: 234c76c5d3bc5e68d89ec7a683bfb702e6864688 [file] [log] [blame]
Greg Danielfe71b9d2017-03-09 10:41:31 -05001/*
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
Greg Daniela5cb7812017-06-16 09:45:32 -040013#include "GrRenderTargetProxy.h"
Greg Danielfe71b9d2017-03-09 10:41:31 -050014#include "GrSemaphore.h"
15#include "SkRefCnt.h"
16
17class GrSemaphoreOp : public GrOp {
18public:
Robert Phillips7c525e62018-06-12 10:11:12 -040019 static std::unique_ptr<GrOp> MakeSignal(GrContext*,
20 sk_sp<GrSemaphore>,
21 GrRenderTargetProxy*,
22 bool forceFlush);
Greg Danielfe71b9d2017-03-09 10:41:31 -050023
Robert Phillips7c525e62018-06-12 10:11:12 -040024 static std::unique_ptr<GrOp> MakeWait(GrContext*,
25 sk_sp<GrSemaphore>,
26 GrRenderTargetProxy*);
Greg Danielfe71b9d2017-03-09 10:41:31 -050027
28protected:
Greg Daniela5cb7812017-06-16 09:45:32 -040029 GrSemaphoreOp(uint32_t classId, sk_sp<GrSemaphore> semaphore, GrRenderTargetProxy* proxy)
30 : INHERITED(classId), fSemaphore(std::move(semaphore)) {
Robert Phillips65a88fa2017-08-08 08:36:22 -040031 this->makeFullScreen(proxy);
Greg Daniela5cb7812017-06-16 09:45:32 -040032 }
Greg Danielfe71b9d2017-03-09 10:41:31 -050033
34 sk_sp<GrSemaphore> fSemaphore;
35
36private:
37 bool onCombineIfPossible(GrOp* that, const GrCaps& caps) override { return false; }
38 void onPrepare(GrOpFlushState*) override {}
39
40 typedef GrOp INHERITED;
41};
42
43#endif