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/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 68b8b8e..6896526 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -765,7 +765,7 @@
stencilSettings);
}
- AAConvexPathOp(const Helper::MakeArgs& helperArgs, GrColor color, const SkMatrix& viewMatrix,
+ AAConvexPathOp(const Helper::MakeArgs& helperArgs, GrColor4h color, const SkMatrix& viewMatrix,
const SkPath& path, const GrUserStencilSettings* stencilSettings)
: INHERITED(ClassID()), fHelper(helperArgs, GrAAType::kCoverage, stencilSettings) {
fPaths.emplace_back(PathData{viewMatrix, path, color});
@@ -843,7 +843,8 @@
return;
}
- extract_lines_only_verts(tess, verts, vertexStride, args.fColor, idxs,
+ // TODO4F: Preserve float colors
+ extract_lines_only_verts(tess, verts, vertexStride, args.fColor.toGrColor(), idxs,
fHelper.compatibleWithAlphaAsCoverage());
GrMesh* mesh = target->allocMesh(GrPrimitiveType::kTriangles);
@@ -929,7 +930,8 @@
}
SkSTArray<kPreallocDrawCnt, Draw, true> draws;
- create_vertices(segments, fanPt, args.fColor, &draws, verts, idxs);
+ // TODO4F: Preserve float colors
+ create_vertices(segments, fanPt, args.fColor.toGrColor(), &draws, verts, idxs);
GrMesh* meshes = target->allocMeshes(draws.count());
for (int j = 0; j < draws.count(); ++j) {
@@ -967,7 +969,7 @@
struct PathData {
SkMatrix fViewMatrix;
SkPath fPath;
- GrColor fColor;
+ GrColor4h fColor;
};
Helper fHelper;