aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBlend.h
blob: e70d9457772c30e1f5a5660c5a25b98c58043a1a (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
38
39
40
41
42
43
44
45

/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "GrTypes.h"
#include "GrColor.h"

#ifndef GrBlend_DEFINED
#define GrBlend_DEFINED

static inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) {
    switch (coeff) {
        case kSC_GrBlendCoeff:
        case kISC_GrBlendCoeff:
        case kSA_GrBlendCoeff:
        case kISA_GrBlendCoeff:
            return true;
        default:
            return false;
    }
}

static inline bool GrBlendCoeffRefsDst(GrBlendCoeff coeff) {
    switch (coeff) {
        case kDC_GrBlendCoeff:
        case kIDC_GrBlendCoeff:
        case kDA_GrBlendCoeff:
        case kIDA_GrBlendCoeff:
            return true;
        default:
            return false;
    }
}

GrColor GrSimplifyBlend(GrBlendCoeff* srcCoeff,
                        GrBlendCoeff* dstCoeff,
                        GrColor srcColor, uint32_t srcCompFlags,
                        GrColor dstColor, uint32_t dstCompFlags,
                        GrColor constantColor);

#endif