Avoid rerunning path renderer chain when path known to require sw
Change-Id: If8bdeadf95543917a6e00570b5806a3ee23aa335 Reviewed-on: https://skia-review.googlesource.com/126508 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
6198f39adc
commit
e7df0bb900
@ -466,19 +466,24 @@ GrPathRenderer* GrDrawingManager::getPathRenderer(const GrPathRenderer::CanDrawP
|
||||
|
||||
GrPathRenderer* pr = fPathRendererChain->getPathRenderer(args, drawType, stencilSupport);
|
||||
if (!pr && allowSW) {
|
||||
if (!fSoftwarePathRenderer) {
|
||||
fSoftwarePathRenderer =
|
||||
new GrSoftwarePathRenderer(fContext->contextPriv().proxyProvider(),
|
||||
fOptionsForPathRendererChain.fAllowPathMaskCaching);
|
||||
}
|
||||
if (GrPathRenderer::CanDrawPath::kNo != fSoftwarePathRenderer->canDrawPath(args)) {
|
||||
pr = fSoftwarePathRenderer;
|
||||
auto swPR = this->getSoftwarePathRenderer();
|
||||
if (GrPathRenderer::CanDrawPath::kNo != swPR->canDrawPath(args)) {
|
||||
pr = swPR;
|
||||
}
|
||||
}
|
||||
|
||||
return pr;
|
||||
}
|
||||
|
||||
GrPathRenderer* GrDrawingManager::getSoftwarePathRenderer() {
|
||||
if (!fSoftwarePathRenderer) {
|
||||
fSoftwarePathRenderer =
|
||||
new GrSoftwarePathRenderer(fContext->contextPriv().proxyProvider(),
|
||||
fOptionsForPathRendererChain.fAllowPathMaskCaching);
|
||||
}
|
||||
return fSoftwarePathRenderer;
|
||||
}
|
||||
|
||||
GrCoverageCountingPathRenderer* GrDrawingManager::getCoverageCountingPathRenderer() {
|
||||
if (!fPathRendererChain) {
|
||||
fPathRendererChain = new GrPathRendererChain(fContext, fOptionsForPathRendererChain);
|
||||
|
@ -59,6 +59,8 @@ public:
|
||||
GrPathRendererChain::DrawType drawType,
|
||||
GrPathRenderer::StencilSupport* stencilSupport = nullptr);
|
||||
|
||||
GrPathRenderer* getSoftwarePathRenderer();
|
||||
|
||||
// Returns a direct pointer to the coverage counting path renderer, or null if it is not
|
||||
// supported and turned on.
|
||||
GrCoverageCountingPathRenderer* getCoverageCountingPathRenderer();
|
||||
|
@ -1662,9 +1662,11 @@ void GrRenderTargetContext::drawShapeUsingPathRenderer(const GrClip& clip,
|
||||
return;
|
||||
}
|
||||
canDrawArgs.fShape = &tempShape;
|
||||
// This time, allow SW renderer
|
||||
pr = this->drawingManager()->getPathRenderer(canDrawArgs, true, kType);
|
||||
} else {
|
||||
pr = this->drawingManager()->getSoftwarePathRenderer();
|
||||
}
|
||||
// This time, allow SW renderer
|
||||
pr = this->drawingManager()->getPathRenderer(canDrawArgs, true, kType);
|
||||
}
|
||||
|
||||
if (!pr) {
|
||||
|
Loading…
Reference in New Issue
Block a user