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:
parent
95c2994048
commit
b67a336569
@ -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).
|
||||
|
@ -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
|
||||
|
@ -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&);
|
||||
|
Loading…
Reference in New Issue
Block a user