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

Unified Diff: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp

Issue 2006643005: Start on replacing path+style with shape in patherenderer (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rebase after breaking out more Created 4 years, 6 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/batches/GrStencilAndCoverPathRenderer.h ('k') | src/gpu/batches/GrTessellatingPathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index 2a480189fad2aa39a727a91bd6c1d7a88712ceae..0995310c13e295810262c1753c55e15c7016fb37 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -33,9 +33,8 @@ GrStencilAndCoverPathRenderer::GrStencilAndCoverPathRenderer(GrResourceProvider*
}
bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
- // GrPath doesn't support hairline paths. Also, an arbitrary path effect could change
- // the style type to hairline.
- if (args.fStyle->hasNonDashPathEffect() || args.fStyle->strokeRec().isHairlineStyle()) {
+ // GrPath doesn't support hairline paths.
+ if (args.fShape->style().couldBeHairline()) {
return false;
}
if (args.fHasUserStencilSettings) {
@@ -70,6 +69,8 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrStencilAndCoverPathRenderer::onStencilPath");
SkASSERT(!args.fIsAA || args.fDrawContext->isStencilBufferMultisampled());
+ SkPath path;
+ args.fShape->asPath(&path);
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Make());
@@ -77,24 +78,23 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
const GrPipelineBuilder pipelineBuilder(paint, args.fIsAA);
- SkASSERT(!args.fPath->isInverseFillType());
- SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyle::SimpleFill()));
- args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder,
- *args.fClip,
- *args.fViewMatrix,
- path,
- path->getFillType());
+ SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, GrStyle::SimpleFill()));
+ args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, *args.fClip,
+ *args.fViewMatrix, p, p->getFillType());
}
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrStencilAndCoverPathRenderer::onDrawPath");
SkASSERT(!args.fPaint->isAntiAlias() || args.fDrawContext->isStencilBufferMultisampled());
- SkASSERT(!args.fStyle->strokeRec().isHairlineStyle());
- const SkPath& path = *args.fPath;
+ SkASSERT(!args.fShape->style().strokeRec().isHairlineStyle());
+
const SkMatrix& viewMatrix = *args.fViewMatrix;
- SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, *args.fStyle));
+ SkPath path;
+ args.fShape->asPath(&path);
+
+ SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, args.fShape->style()));
if (path.isInverseFillType()) {
static constexpr GrUserStencilSettings kInvertedCoverPass(
« no previous file with comments | « src/gpu/batches/GrStencilAndCoverPathRenderer.h ('k') | src/gpu/batches/GrTessellatingPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698