Use half floats for non-normalized color in GrTextureOp
Bug: skia:
Change-Id: Ie681369ef4b1d3d43c326da684afde9ce6d08486
Reviewed-on: https://skia-review.googlesource.com/c/171726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index daa86fc..ff9e443 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1464,7 +1464,7 @@
sampler.setFilterMode(kNone_SkFilterQuality == filterQuality ? GrSamplerState::Filter::kNearest
: GrSamplerState::Filter::kBilerp);
SkAutoTArray<GrRenderTargetContext::TextureSetEntry> textures(count);
- GrColor color = GrColorPackA4(SkToUInt(SkTClamp(SkScalarRoundToInt(alpha * 255), 0, 255)));
+ SkPMColor4f color = { alpha, alpha, alpha, alpha };
// We accumulate compatible proxies until we find an an incompatible one or reach the end and
// issue the accumulated 'n' draws starting at 'base'.
int base = 0, n = 0;
@@ -1475,7 +1475,7 @@
fRenderTargetContext->colorSpaceInfo().colorSpace(), kPremul_SkAlphaType);
fRenderTargetContext->drawTextureSet(this->clip(), textures.get() + base, n,
sampler.filter(), color, this->ctm(),
- std::move(textureXform), nullptr);
+ std::move(textureXform));
}
};
for (int i = 0; i < count; ++i) {