aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrSemaphoreOp.h
blob: a88b66cfc754c38bdafe626438b06d37101d8795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrSemaphoreOp_DEFINED
#define GrSemaphoreOp_DEFINED

#include "GrOp.h"

#include "GrSemaphore.h"
#include "SkRefCnt.h"

class GrSemaphoreOp : public GrOp {
public:
    static std::unique_ptr<GrSemaphoreOp> MakeSignal(sk_sp<GrSemaphore> semaphore);

    static std::unique_ptr<GrSemaphoreOp> MakeWait(sk_sp<GrSemaphore> semaphore);

protected:
    GrSemaphoreOp(uint32_t classId, sk_sp<GrSemaphore> semaphore)
        : INHERITED(classId), fSemaphore(std::move(semaphore)) {}

    sk_sp<GrSemaphore> fSemaphore;

private:
    bool onCombineIfPossible(GrOp* that, const GrCaps& caps) override { return false; }
    void onPrepare(GrOpFlushState*) override {}

    typedef GrOp INHERITED;
};

#endif