Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1407883004: Remove GrPipelineBuilder from getPathRenderer call (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Hide GrContext::drawingManager entry point Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index d64273a8288bcb776d22a44190c3999258e97e21..82e1057c6a0a1cb9c0b2b971c08aebd7657af538 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -680,21 +680,28 @@ void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder,
// thing WRT to the blend then we'll need some query on the PR.
bool useCoverageAA = useAA &&
!pipelineBuilder->getRenderTarget()->isUnifiedMultisampled();
+ bool isStencilDisabled = pipelineBuilder->getStencil().isDisabled();
+ bool isStencilBufferMSAA = pipelineBuilder->getRenderTarget()->isStencilBufferMultisampled();
-
- GrPathRendererChain::DrawType type =
- useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType :
- GrPathRendererChain::kColor_DrawType;
+ const GrPathRendererChain::DrawType type =
+ useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType
+ : GrPathRendererChain::kColor_DrawType;
const SkPath* pathPtr = &path;
SkTLazy<SkPath> tmpPath;
const GrStrokeInfo* strokeInfoPtr = &strokeInfo;
+ GrPathRenderer::CanDrawPathArgs canDrawArgs;
+ canDrawArgs.fShaderCaps = fDrawingManager->getContext()->caps()->shaderCaps();
+ canDrawArgs.fViewMatrix = &viewMatrix;
+ canDrawArgs.fPath = pathPtr;
+ canDrawArgs.fStroke = strokeInfoPtr;
+ canDrawArgs.fAntiAlias = useCoverageAA;
+ canDrawArgs.fIsStencilDisabled = isStencilDisabled;
+ canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA;
+
// Try a 1st time without stroking the path and without allowing the SW renderer
- GrPathRenderer* pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder,
- viewMatrix, *pathPtr,
- *strokeInfoPtr, false,
- type);
+ GrPathRenderer* pr = fDrawingManager->getPathRenderer(canDrawArgs, false, type);
GrStrokeInfo dashlessStrokeInfo(strokeInfo, false);
if (nullptr == pr && strokeInfo.isDashed()) {
@@ -707,9 +714,11 @@ void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder,
return;
}
strokeInfoPtr = &dashlessStrokeInfo;
- pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix,
- *pathPtr, *strokeInfoPtr,
- false, type);
+
+ canDrawArgs.fPath = pathPtr;
+ canDrawArgs.fStroke = strokeInfoPtr;
+
+ pr = fDrawingManager->getPathRenderer(canDrawArgs, false, type);
}
if (nullptr == pr) {
@@ -731,10 +740,11 @@ void GrDrawContext::internalDrawPath(GrPipelineBuilder* pipelineBuilder,
strokeInfoPtr = &dashlessStrokeInfo;
}
+ canDrawArgs.fPath = pathPtr;
+ canDrawArgs.fStroke = strokeInfoPtr;
+
// This time, allow SW renderer
- pr = fDrawingManager->getContext()->getPathRenderer(*pipelineBuilder, viewMatrix,
- *pathPtr, *strokeInfoPtr,
- true, type);
+ pr = fDrawingManager->getPathRenderer(canDrawArgs, true, type);
}
if (nullptr == pr) {
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698