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/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp
index 9235cce..f725675 100644
--- a/src/gpu/ops/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp
@@ -190,14 +190,14 @@
SkString dumpInfo() const override {
SkString string;
- string.appendf("Color 0x%08x, aa: %d\n", fColor, fAntiAlias);
+ string.appendf("Color 0x%08x, aa: %d\n", fColor.toGrColor(), fAntiAlias);
string += fHelper.dumpInfo();
string += INHERITED::dumpInfo();
return string;
}
TessellatingPathOp(Helper::MakeArgs helperArgs,
- GrColor color,
+ GrColor4h color,
const GrShape& shape,
const SkMatrix& viewMatrix,
const SkIRect& devClipBounds,
@@ -300,8 +300,10 @@
SkScalar tol = GrPathUtils::kDefaultTolerance;
bool isLinear;
DynamicVertexAllocator allocator(vertexStride, target);
+ // TODO4F: Preserve float colors
int count =
- GrTessellator::PathToTriangles(path, tol, clipBounds, &allocator, true, fColor,
+ GrTessellator::PathToTriangles(path, tol, clipBounds, &allocator, true,
+ fColor.toGrColor(),
fHelper.compatibleWithAlphaAsCoverage(), &isLinear);
if (count == 0) {
return;
@@ -367,7 +369,7 @@
}
Helper fHelper;
- GrColor fColor;
+ GrColor4h fColor;
GrShape fShape;
SkMatrix fViewMatrix;
SkIRect fDevClipBounds;