From ab5fec9cd185933ee21a1bf6f0e00f081edf49a3 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 16 Aug 2018 19:43:31 +0000 Subject: [PATCH] Revert "avoid illegal enum values in GrGLGpu" This reverts commit 7ca217b3b2b691d09195924c0f1fa03c10e9858f. 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 > Commit-Queue: Mike Klein 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 Commit-Queue: Mike Klein --- src/gpu/gl/GrGLGpu.cpp | 7 ++----- src/gpu/gl/GrGLGpu.h | 10 +++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 090cf212d7..22f79227ac 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -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))) { diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 764da19c58..743a51686e 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -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(-1); + fSrcCoeff = static_cast(-1); + fDstCoeff = static_cast(-1); fConstColorValid = false; fEnabled = kUnknown_TriState; }