Replace GrColor4h with SkPMColor4f
- Mechanical replacement of GrColor4h (used throughout Ops) with
SkPMColor4f.
- API adaptation (to/FromGrColor -> to/From_BytesRGBA).
- Complete removal of FromFloats (source was already SkPMColor4f),
and toFloats (setting uniforms can directly access .vec()).
Bug: skia:
Change-Id: I37eece1fa7ed2545dc6843e840d4cc3c60f19747
Reviewed-on: https://skia-review.googlesource.com/c/166620
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp
index 2ce89de..34fa6a9 100644
--- a/src/gpu/ops/GrRegionOp.cpp
+++ b/src/gpu/ops/GrRegionOp.cpp
@@ -70,8 +70,9 @@
aaType, stencilSettings);
}
- RegionOp(const Helper::MakeArgs& helperArgs, const GrColor4h& color, const SkMatrix& viewMatrix,
- const SkRegion& region, GrAAType aaType, const GrUserStencilSettings* stencilSettings)
+ RegionOp(const Helper::MakeArgs& helperArgs, const SkPMColor4f& color,
+ const SkMatrix& viewMatrix, const SkRegion& region, GrAAType aaType,
+ const GrUserStencilSettings* stencilSettings)
: INHERITED(ClassID())
, fHelper(helperArgs, aaType, stencilSettings)
, fViewMatrix(viewMatrix) {
@@ -94,7 +95,7 @@
str.appendf("# combined: %d\n", fRegions.count());
for (int i = 0; i < fRegions.count(); ++i) {
const RegionInfo& info = fRegions[i];
- str.appendf("%d: Color: 0x%08x, Region with %d rects\n", i, info.fColor.toGrColor(),
+ str.appendf("%d: Color: 0x%08x, Region with %d rects\n", i, info.fColor.toBytes_RGBA(),
info.fRegion.computeRegionComplexity());
}
str += fHelper.dumpInfo();
@@ -140,7 +141,7 @@
intptr_t verts = reinterpret_cast<intptr_t>(vertices);
for (int i = 0; i < numRegions; i++) {
// TODO4F: Preserve float colors
- tesselate_region(verts, kVertexStride, fRegions[i].fColor.toGrColor(),
+ tesselate_region(verts, kVertexStride, fRegions[i].fColor.toBytes_RGBA(),
fRegions[i].fRegion);
int numRectsInRegion = fRegions[i].fRegion.computeRegionComplexity();
verts += numRectsInRegion * kVertsPerInstance * kVertexStride;
@@ -164,7 +165,7 @@
}
struct RegionInfo {
- GrColor4h fColor;
+ SkPMColor4f fColor;
SkRegion fRegion;
};