Delay half-float vertex color determination until Op::finalize
Bug: skia:8871
Change-Id: I873e80e2d97a32e4524c177a9b6e07b0566a02ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201682
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index 51dd6ad..677e301 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -16,6 +16,7 @@
#include "GrSimpleMeshDrawOpHelper.h"
#include "GrVertexWriter.h"
#include "SkBitmap.h"
+#include "SkGr.h"
#include "SkLatticeIter.h"
#include "SkMatrixPriv.h"
#include "SkRect.h"
@@ -165,7 +166,6 @@
// setup bounds
this->setTransformedBounds(patch.fDst, viewMatrix, HasAABloat::kNo, IsZeroArea::kNo);
- fWideColor = !SkPMColor4fFitsInBytes(color);
}
const char* name() const override { return "NonAALatticeOp"; }
@@ -203,6 +203,7 @@
GrProcessorAnalysisCoverage::kNone,
&analysisColor);
analysisColor.isConstant(&fPatches[0].fColor);
+ fWideColor = SkPMColor4fNeedsWideColor(fPatches[0].fColor, clampType, caps);
return result;
}