michael@0: michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #include "GrTypes.h" michael@0: #include "GrColor.h" michael@0: michael@0: #ifndef GrBlend_DEFINED michael@0: #define GrBlend_DEFINED michael@0: michael@0: static inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) { michael@0: switch (coeff) { michael@0: case kSC_GrBlendCoeff: michael@0: case kISC_GrBlendCoeff: michael@0: case kSA_GrBlendCoeff: michael@0: case kISA_GrBlendCoeff: michael@0: return true; michael@0: default: michael@0: return false; michael@0: } michael@0: } michael@0: michael@0: static inline bool GrBlendCoeffRefsDst(GrBlendCoeff coeff) { michael@0: switch (coeff) { michael@0: case kDC_GrBlendCoeff: michael@0: case kIDC_GrBlendCoeff: michael@0: case kDA_GrBlendCoeff: michael@0: case kIDA_GrBlendCoeff: michael@0: return true; michael@0: default: michael@0: return false; michael@0: } michael@0: } michael@0: michael@0: GrColor GrSimplifyBlend(GrBlendCoeff* srcCoeff, michael@0: GrBlendCoeff* dstCoeff, michael@0: GrColor srcColor, uint32_t srcCompFlags, michael@0: GrColor dstColor, uint32_t dstCompFlags, michael@0: GrColor constantColor); michael@0: michael@0: #endif