Disable inner fan triangulation for the tessellation atlas

Temporarily puts inner fan triangulation behind a flag so we can
disable it for the atlas. The next CL will do the same thing by
creating an op that doesn't triangulate, but making the functional
change in this CL allows us to triage the diffs ahead of time. It will
also ensure the next CL doesn't introduce any others diffs.

Bug: skia:10419
Change-Id: Ia498957c53e83fe40aa797cadace171902dbf548
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357137
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2021-01-21 22:06:04 -07:00 committed by Skia Commit-Bot
parent 95c2994048
commit b67a336569
3 changed files with 6 additions and 3 deletions

View File

@ -78,7 +78,8 @@ void GrPathTessellateOp::prePreparePrograms(const PrePrepareArgs& args) {
const SkRect& bounds = fPath.getBounds();
float gpuFragmentWork = bounds.height() * scales[0] * bounds.width() * scales[1];
float cpuTessellationWork = (float)numVerbs * SkNextLog2(numVerbs); // N log N.
if (cpuTessellationWork * 500 + (256 * 256) < gpuFragmentWork) { // Don't try below 256x256.
if (!(fOpFlags & OpFlags::kDisableInnerFanTriangulation) &&
cpuTessellationWork * 500 + (256 * 256) < gpuFragmentWork) { // Don't try below 256x256.
bool isLinear;
// This will fail if the inner triangles do not form a simple polygon (e.g., self
// intersection, double winding).

View File

@ -68,7 +68,8 @@ void GrTessellationPathRenderer::initAtlasFlags(GrRecordingContext* rContext) {
return;
}
fStencilAtlasFlags = OpFlags::kStencilOnly | OpFlags::kDisableHWTessellation;
fStencilAtlasFlags = OpFlags::kStencilOnly | OpFlags::kDisableHWTessellation |
OpFlags::kDisableInnerFanTriangulation;
fMaxAtlasPathWidth = fAtlas.maxAtlasSize() / 2;
// The atlas usually does better with hardware tessellation. If hardware tessellation is

View File

@ -40,7 +40,8 @@ public:
// the max number of segments supported by the hardware.
kDisableHWTessellation = (1 << 0),
kStencilOnly = (1 << 1),
kWireframe = (1 << 2)
kWireframe = (1 << 2),
kDisableInnerFanTriangulation = (1 << 3) // TEMPORARY
};
static bool IsSupported(const GrCaps&);