Revert "Revert "Use float colors for blend constant""
This reverts commit 5a4f2a341a4a32d8f175afe1828a7796155dbcb8.
Bug: skia:
Change-Id: I706009343dc1976311a88d57800a140efd776861
Reviewed-on: https://skia-review.googlesource.com/c/168363
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/mtl/GrMtlPipelineState.mm b/src/gpu/mtl/GrMtlPipelineState.mm
index 590eff6..1d9562e 100644
--- a/src/gpu/mtl/GrMtlPipelineState.mm
+++ b/src/gpu/mtl/GrMtlPipelineState.mm
@@ -185,16 +185,14 @@
GrBlendCoeff srcCoeff = blendInfo.fSrcBlend;
GrBlendCoeff dstCoeff = blendInfo.fDstBlend;
if (blend_coeff_refs_constant(srcCoeff) || blend_coeff_refs_constant(dstCoeff)) {
- float floatColors[4];
// Swizzle the blend to match what the shader will output.
const GrSwizzle& swizzle = fGpu->caps()->shaderCaps()->configOutputSwizzle(config);
- GrColor blendConst = swizzle.applyTo(blendInfo.fBlendConstant);
- GrColorToRGBAFloat(blendConst, floatColors);
+ SkPMColor4f blendConst = swizzle.applyTo(blendInfo.fBlendConstant);
- [renderCmdEncoder setBlendColorRed: floatColors[0]
- green: floatColors[1]
- blue: floatColors[2]
- alpha: floatColors[3]];
+ [renderCmdEncoder setBlendColorRed: blendConst.fR
+ green: blendConst.fG
+ blue: blendConst.fB
+ alpha: blendConst.fA];
}
}