Clean up prior to making GrPathRenderers OGA-only
GrCpuVertexAllocator, GrIsStrokeHairlineOrEquivalent and kLinearizationPrecision are still
useful in the NGA so divorce them from OGA-only classes.
Bug: skia:11837
Change-Id: Ib10e6b5448e0eb2b62c0178cfd019009a3a2e952
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418148
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index ae5b270..5775849 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -22,6 +22,7 @@
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrSimpleMesh.h"
#include "src/gpu/GrStyle.h"
+#include "src/gpu/GrUtil.h"
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
@@ -566,7 +567,7 @@
SkScalar hairlineCoverage;
uint8_t newCoverage = 0xff;
bool isHairline = false;
- if (IsStrokeHairlineOrEquivalent(shape.style(), viewMatrix, &hairlineCoverage)) {
+ if (GrIsStrokeHairlineOrEquivalent(shape.style(), viewMatrix, &hairlineCoverage)) {
newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff);
isHairline = true;
} else {
@@ -696,7 +697,7 @@
GrPathRenderer::CanDrawPath
GrDefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
- bool isHairline = IsStrokeHairlineOrEquivalent(
+ bool isHairline = GrIsStrokeHairlineOrEquivalent(
args.fShape->style(), *args.fViewMatrix, nullptr);
// If we aren't a single_pass_shape or hairline, we require stencil buffers.
if (!(single_pass_shape(*args.fShape) || isHairline) &&