Add isUnblended query to GrDrawState.
BUG=skia: Review URL: https://codereview.chromium.org/715873002
This commit is contained in:
parent
453cf40ac7
commit
cd8b6307fe
@ -742,3 +742,23 @@ bool GrDrawState::srcAlphaWillBeOne() const {
|
||||
return inoutColor.isOpaque();
|
||||
}
|
||||
|
||||
bool GrDrawState::willBlendWithDst() const {
|
||||
if (!this->hasSolidCoverage()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool srcAIsOne = this->srcAlphaWillBeOne();
|
||||
GrBlendCoeff srcCoeff = this->getSrcBlendCoeff();
|
||||
GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
|
||||
if (kISA_GrBlendCoeff == dstCoeff && srcAIsOne) {
|
||||
dstCoeff = kZero_GrBlendCoeff;
|
||||
}
|
||||
if (kOne_GrBlendCoeff != srcCoeff ||
|
||||
kZero_GrBlendCoeff != dstCoeff ||
|
||||
this->willEffectReadDstColor()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -159,6 +159,12 @@ public:
|
||||
*/
|
||||
bool hasSolidCoverage() const;
|
||||
|
||||
/**
|
||||
* This function returns true if the render target destination pixel values will be read for
|
||||
* blending during draw.
|
||||
*/
|
||||
bool willBlendWithDst() const;
|
||||
|
||||
/// @}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user