GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
+ // None of our copy methods can handle a swizzle. TODO: Make copySurfaceAsDraw handle the
+ // swizzle.
+ if (gpu->caps()->shaderCaps()->configOutputSwizzle(src->config()) !=
+ gpu->caps()->shaderCaps()->configOutputSwizzle(dst->config())) {
+ return false;
+ }
+
if (!gpu->vkCaps().supportsCopiesAsDraws()) {
return false;
}
GrBlendCoeff dstCoeff = blendInfo.fDstBlend;
float floatColors[4];
if (blend_coeff_refs_constant(srcCoeff) || blend_coeff_refs_constant(dstCoeff)) {
- GrColorToRGBAFloat(blendInfo.fBlendConstant, floatColors);
+ // Swizzle the blend to match what the shader will output.
+ const GrSwizzle& swizzle = gpu->caps()->shaderCaps()->configOutputSwizzle(
+ pipeline.getRenderTarget()->config());
+ GrColor blendConst = swizzle.applyTo(blendInfo.fBlendConstant);
+ GrColorToRGBAFloat(blendConst, floatColors);
} else {
memset(floatColors, 0, 4 * sizeof(float));
}