Revert "avoid illegal enum values in GrGLGpu"
This reverts commit 7ca217b3b2
.
Reason for revert:
Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-All-Android ?
Original change's description:
> avoid illegal enum values in GrGLGpu
>
> This tracks the state of the blend equation and coefficients
> using an out-of-band bool rather than an illegal enum value.
>
> This was caught by -fsanitize=enum.
>
> This CL doesn't change the size of fHWBlendState.
>
> Change-Id: I8dbc8aaaa07e82186c148ceb19590390051eb296
> Reviewed-on: https://skia-review.googlesource.com/146962
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,csmartdalton@google.com
Change-Id: I508cc6a49fcc68907086dcde904db2f791802474
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/147600
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
8d77d1d85e
commit
ab5fec9cd1
@ -2611,10 +2611,9 @@ void GrGLGpu::flushBlend(const GrXferProcessor::BlendInfo& blendInfo, const GrSw
|
||||
fHWBlendState.fEnabled = kYes_TriState;
|
||||
}
|
||||
|
||||
if (!fHWBlendState.fEquationValid || fHWBlendState.fEquation != equation) {
|
||||
if (fHWBlendState.fEquation != equation) {
|
||||
GL_CALL(BlendEquation(gXfermodeEquation2Blend[equation]));
|
||||
fHWBlendState.fEquation = equation;
|
||||
fHWBlendState.fEquationValid = true;
|
||||
}
|
||||
|
||||
if (GrBlendEquationIsAdvanced(equation)) {
|
||||
@ -2623,13 +2622,11 @@ void GrGLGpu::flushBlend(const GrXferProcessor::BlendInfo& blendInfo, const GrSw
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fHWBlendState.fCoeffsValid || fHWBlendState.fSrcCoeff != srcCoeff
|
||||
|| fHWBlendState.fDstCoeff != dstCoeff) {
|
||||
if (fHWBlendState.fSrcCoeff != srcCoeff || fHWBlendState.fDstCoeff != dstCoeff) {
|
||||
GL_CALL(BlendFunc(gXfermodeCoeff2Blend[srcCoeff],
|
||||
gXfermodeCoeff2Blend[dstCoeff]));
|
||||
fHWBlendState.fSrcCoeff = srcCoeff;
|
||||
fHWBlendState.fDstCoeff = dstCoeff;
|
||||
fHWBlendState.fCoeffsValid = true;
|
||||
}
|
||||
|
||||
if ((BlendCoeffReferencesConstant(srcCoeff) || BlendCoeffReferencesConstant(dstCoeff))) {
|
||||
|
@ -550,17 +550,13 @@ private:
|
||||
GrBlendCoeff fSrcCoeff;
|
||||
GrBlendCoeff fDstCoeff;
|
||||
GrColor fConstColor;
|
||||
|
||||
bool fEquationValid;
|
||||
bool fCoeffsValid;
|
||||
bool fConstColorValid;
|
||||
/* there's a spare byte here */
|
||||
|
||||
TriState fEnabled;
|
||||
|
||||
void invalidate() {
|
||||
fEquationValid = false;
|
||||
fCoeffsValid = false;
|
||||
fEquation = static_cast<GrBlendEquation>(-1);
|
||||
fSrcCoeff = static_cast<GrBlendCoeff>(-1);
|
||||
fDstCoeff = static_cast<GrBlendCoeff>(-1);
|
||||
fConstColorValid = false;
|
||||
fEnabled = kUnknown_TriState;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user