Don't use triangle fans in default path renderer
Change-Id: Ie5dc65adfb843ba22690fe624c8bcb882a5fe43f Reviewed-on: https://skia-review.googlesource.com/123744 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
7d4a575206
commit
06c330410b
@ -400,19 +400,16 @@ private:
|
||||
|
||||
int instanceCount = fPaths.count();
|
||||
|
||||
// We will use index buffers if we have multiple paths or one path with multiple contours
|
||||
bool isIndexed = instanceCount > 1;
|
||||
for (int i = 0; !isIndexed && i < instanceCount; i++) {
|
||||
const PathData& args = fPaths[i];
|
||||
isIndexed = isIndexed || PathGeoBuilder::PathHasMultipleSubpaths(args.fPath);
|
||||
}
|
||||
// We avoid indices when we have a single hairline contour.
|
||||
bool isIndexed = !this->isHairline() || instanceCount > 1 ||
|
||||
PathGeoBuilder::PathHasMultipleSubpaths(fPaths[0].fPath);
|
||||
|
||||
// determine primitiveType
|
||||
GrPrimitiveType primitiveType;
|
||||
if (this->isHairline()) {
|
||||
primitiveType = isIndexed ? GrPrimitiveType::kLines : GrPrimitiveType::kLineStrip;
|
||||
} else {
|
||||
primitiveType = isIndexed ? GrPrimitiveType::kTriangles : GrPrimitiveType::kTriangleFan;
|
||||
primitiveType = GrPrimitiveType::kTriangles;
|
||||
}
|
||||
|
||||
PathGeoBuilder pathGeoBuilder(primitiveType, target, gp.get(),
|
||||
|
Loading…
Reference in New Issue
Block a user