1 
2 /*
3  * Copyright 2013 Google Inc.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 #include "GrTypes.h"
10 #include "GrColor.h"
11 #include "GrXferProcessor.h"
12 
13 #ifndef GrBlend_DEFINED
14 #define GrBlend_DEFINED
15 
GrBlendCoeffRefsSrc(GrBlendCoeff coeff)16 static inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) {
17     switch (coeff) {
18         case kSC_GrBlendCoeff:
19         case kISC_GrBlendCoeff:
20         case kSA_GrBlendCoeff:
21         case kISA_GrBlendCoeff:
22             return true;
23         default:
24             return false;
25     }
26 }
27 
GrBlendCoeffRefsDst(GrBlendCoeff coeff)28 static inline bool GrBlendCoeffRefsDst(GrBlendCoeff coeff) {
29     switch (coeff) {
30         case kDC_GrBlendCoeff:
31         case kIDC_GrBlendCoeff:
32         case kDA_GrBlendCoeff:
33         case kIDA_GrBlendCoeff:
34             return true;
35         default:
36             return false;
37     }
38 }
39 
40 GrColor GrSimplifyBlend(GrBlendCoeff* srcCoeff,
41                         GrBlendCoeff* dstCoeff,
42                         GrColor srcColor, uint32_t srcCompFlags,
43                         GrColor dstColor, uint32_t dstCompFlags,
44                         GrColor constantColor);
45 
46 #endif
47