aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuCommandBuffer.h
blob: 3c6e6116fb6a17f61bd0fb23ac0b270de0baa0c9 (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
36
37
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

#ifndef GrGpuCommandBuffer_DEFINED
#define GrGpuCommandBuffer_DEFINED

#include "GrColor.h"

class GrRenderTarget;

class GrGpuCommandBuffer {
public:
    enum LoadAndStoreOp {
        kLoadAndStore_LoadAndStoreOp,
        kLoadAndDiscard_LoadAndStoreOp,
        kClearAndStore_LoadAndStoreOp,
        kClearAndDiscard_LoadAndStoreOp,
        kDiscardAndStore_LoadAndStoreOp,
        kDiscardAndDiscard_LoadAndStoreOp,
    };

    GrGpuCommandBuffer() {}
    virtual ~GrGpuCommandBuffer() {}

    // Signals the end of recording to the command buffer and that it can now be submitted.
    virtual void end() = 0;

    // Sends the command buffer off to the GPU object to execute the commands built up in the
    // buffer. The gpu object is allowed to defer execution of the commands until it is flushed.
    virtual void submit() = 0;
};

#endif