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

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

Issue 2348543002: Avoid unnecessary GrShape->SkPath conversion in GrStencilAndCoverPathRenderer (Closed)
Patch Set: Created 4 years, 3 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/GrDrawPathBatch.h ('k') | no next file » | 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 69a3142f21d32c901837c27a8a184c232495f238..3bbd1574a94c01ef5034526fc45318e05c716e7a 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -94,12 +94,10 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
const SkMatrix& viewMatrix = *args.fViewMatrix;
- SkPath path;
- args.fShape->asPath(&path);
- SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fShape));
+ SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fShape));
- if (path.isInverseFillType()) {
+ if (args.fShape->inverseFilled()) {
SkMatrix invert = SkMatrix::I();
SkRect bounds =
SkRect::MakeLTRB(0, 0,
@@ -126,7 +124,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
// fake inverse with a stencil and cover
args.fDrawContext->drawContextPriv().stencilPath(*args.fClip, args.fPaint->isAntiAlias(),
- viewMatrix, p);
+ viewMatrix, path);
{
static constexpr GrUserStencilSettings kInvertedCoverPass(
@@ -160,8 +158,8 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
0xffff>()
);
- SkAutoTUnref<GrDrawBatch> batch(
- GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), p->getFillType(), p));
+ SkAutoTUnref<GrDrawBatch> batch(GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(),
+ path));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias());
pipelineBuilder.setUserStencil(&kCoverPass);
« no previous file with comments | « src/gpu/batches/GrDrawPathBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698