diff options
author | 2018-05-23 22:51:22 +0000 | |
---|---|---|
committer | 2018-05-23 22:51:33 +0000 | |
commit | 13235d8966e4242ef69264aa76ad71ac4021e506 (patch) | |
tree | c5d3530ee6e28d118d759a78d1af950600c0d261 /src/gpu/ccpr/GrCCDrawPathsOp.cpp | |
parent | c877a404e02772ff650a09a18f64844e4df745a0 (diff) |
Revert "ccpr: Handle winding and even-odd in the same shader"
This reverts commit 5dd3fccb3c7d9fce2663803a1284734237d8546d.
Reason for revert: fma() not supported pre-3.1
Original change's description:
> ccpr: Handle winding and even-odd in the same shader
>
> We are already waiting for an entire texture lookup anyway. A couple
> extra flops should still complete before the texture fetch. This also
> gives us better batching.
>
> Bug: skia:
> Change-Id: I83a7a8ba6c05cd1ad6b1756a987429233e69ed6c
> Reviewed-on: https://skia-review.googlesource.com/129422
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: Iaa6b72686fdf89b58a0ea8418296985c2a3dc27e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/129900
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCDrawPathsOp.cpp')
-rw-r--r-- | src/gpu/ccpr/GrCCDrawPathsOp.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp index 39c1b26223..b3fd711a69 100644 --- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp +++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp @@ -60,7 +60,8 @@ bool GrCCDrawPathsOp::onCombineIfPossible(GrOp* op, const GrCaps& caps) { SkASSERT(!that->fOwningPerOpListPaths || that->fOwningPerOpListPaths == fOwningPerOpListPaths); SkASSERT(that->fNumDraws); - if (fSRGBFlags != that->fSRGBFlags || fProcessors != that->fProcessors || + if (this->getFillType() != that->getFillType() || fSRGBFlags != that->fSRGBFlags || + fProcessors != that->fProcessors || fViewMatrixIfUsingLocalCoords != that->fViewMatrixIfUsingLocalCoords) { return false; } @@ -94,35 +95,35 @@ void GrCCDrawPathsOp::setupResources(GrCCPerFlushResources* resources, const GrCCAtlas* currentAtlas = nullptr; SkASSERT(fNumDraws > 0); SkASSERT(-1 == fBaseInstance); - fBaseInstance = resources->nextPathInstanceIdx(); + fBaseInstance = resources->pathInstanceCount(); for (const SingleDraw& draw : fDraws) { - // renderPathInAtlas gives us two tight bounding boxes: one in device space, as well as a + // addPathToAtlas gives us two tight bounding boxes: one in device space, as well as a // second one rotated an additional 45 degrees. The path vertex shader uses these two // bounding boxes to generate an octagon that circumscribes the path. SkRect devBounds, devBounds45; int16_t atlasOffsetX, atlasOffsetY; - GrCCAtlas* atlas = resources->renderPathInAtlas(*onFlushRP->caps(), draw.fClipIBounds, - draw.fMatrix, draw.fPath, &devBounds, - &devBounds45, &atlasOffsetX, &atlasOffsetY); + GrCCAtlas* atlas = resources->addPathToAtlas(*onFlushRP->caps(), draw.fClipIBounds, + draw.fMatrix, draw.fPath, &devBounds, + &devBounds45, &atlasOffsetX, &atlasOffsetY); if (!atlas) { SkDEBUGCODE(++fNumSkippedInstances); continue; } if (currentAtlas != atlas) { if (currentAtlas) { - this->addAtlasBatch(currentAtlas, resources->nextPathInstanceIdx()); + this->addAtlasBatch(currentAtlas, resources->pathInstanceCount()); } currentAtlas = atlas; } - resources->appendDrawPathInstance().set(draw.fPath.getFillType(), devBounds, devBounds45, - atlasOffsetX, atlasOffsetY, draw.fColor); + resources->appendDrawPathInstance() = + {devBounds, devBounds45, {{atlasOffsetX, atlasOffsetY}}, draw.fColor}; } - SkASSERT(resources->nextPathInstanceIdx() == fBaseInstance + fNumDraws - fNumSkippedInstances); + SkASSERT(resources->pathInstanceCount() == fBaseInstance + fNumDraws - fNumSkippedInstances); if (currentAtlas) { - this->addAtlasBatch(currentAtlas, resources->nextPathInstanceIdx()); + this->addAtlasBatch(currentAtlas, resources->pathInstanceCount()); } } @@ -155,7 +156,7 @@ void GrCCDrawPathsOp::onExecute(GrOpFlushState* flushState) { } GrCCPathProcessor pathProc(flushState->resourceProvider(), - sk_ref_sp(batch.fAtlas->textureProxy()), + sk_ref_sp(batch.fAtlas->textureProxy()), this->getFillType(), fViewMatrixIfUsingLocalCoords); pathProc.drawPaths(flushState, pipeline, resources->indexBuffer(), resources->vertexBuffer(), resources->instanceBuffer(), |