Keep paint color range/precision into ops and GPs (using GrColor4h)
We still degrade to bytes when creating vertices (tagged TODO4F).
Note: Guarded for Chrome (by making GrColor4h a wrapper around
GrColor).
Bug: skia:
Change-Id: Id8a1d9eec7978d52b059cd9952666bc1217ee073
Reviewed-on: https://skia-review.googlesource.com/c/165527
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index 7c14c6c..7c3a834 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -123,7 +123,7 @@
for (int i = 0; i < fGeoCount; ++i) {
str.appendf("%d: Color: 0x%08x Trans: %.2f,%.2f Runs: %d\n",
i,
- fGeoData[i].fColor,
+ fGeoData[i].fColor.toGrColor(),
fGeoData[i].fX,
fGeoData[i].fY,
fGeoData[i].fBlob->runCount());
@@ -346,9 +346,10 @@
for (int i = 0; i < fGeoCount; i++) {
const Geometry& args = fGeoData[i];
Blob* blob = args.fBlob;
+ // TODO4F: Preserve float colors
GrTextBlob::VertexRegenerator regenerator(
resourceProvider, blob, args.fRun, args.fSubRun, args.fViewMatrix, args.fX, args.fY,
- args.fColor, target->deferredUploadTarget(), glyphCache, atlasManager,
+ args.fColor.toGrColor(), target->deferredUploadTarget(), glyphCache, atlasManager,
&autoGlyphCache);
bool done = false;
while (!done) {