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

Unified Diff: src/gpu/GrStencilAndCoverPathRenderer.cpp

Issue 1116123003: Improve caching of dashed paths in GrStencilAndCoverPathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@dashing-nvpr-01
Patch Set: . Created 5 years, 8 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
Index: src/gpu/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index 33b988e277207e6829638c8c1c8bd34b42276bad..86499d39ada96e2ddcad4d160019f07e262c921d 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -60,7 +60,6 @@ bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target,
const GrStrokeInfo& stroke,
bool antiAlias) const {
return !stroke.getStrokeRec().isHairlineStyle() &&
- !stroke.isDashed() &&
!antiAlias && // doesn't do per-path AA, relies on the target having MSAA
pipelineBuilder->getStencil().isDisabled();
}
@@ -73,7 +72,7 @@ GrStencilAndCoverPathRenderer::onGetStencilSupport(const GrDrawTarget*,
return GrPathRenderer::kStencilOnly_StencilSupport;
}
-static GrPath* get_gr_path(GrGpu* gpu, const SkPath& skPath, const SkStrokeRec& stroke) {
+static GrPath* get_gr_path(GrGpu* gpu, const SkPath& skPath, const GrStrokeInfo& stroke) {
GrContext* ctx = gpu->getContext();
GrUniqueKey key;
GrPath::ComputeKey(skPath, stroke, &key);
@@ -93,7 +92,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(GrDrawTarget* target,
const GrStrokeInfo& stroke) {
SkASSERT(!path.isInverseFillType());
SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(GrColor_WHITE, viewMatrix));
- SkAutoTUnref<GrPath> p(get_gr_path(fGpu, path, stroke.getStrokeRec()));
+ SkAutoTUnref<GrPath> p(get_gr_path(fGpu, path, stroke));
target->stencilPath(pipelineBuilder, pp, p, convert_skpath_filltype(path.getFillType()));
}
@@ -106,10 +105,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
bool antiAlias) {
SkASSERT(!antiAlias);
SkASSERT(!stroke.getStrokeRec().isHairlineStyle());
- SkASSERT(!stroke.isDashed());
SkASSERT(pipelineBuilder->getStencil().isDisabled());
- SkAutoTUnref<GrPath> p(get_gr_path(fGpu, path, stroke.getStrokeRec()));
+ SkAutoTUnref<GrPath> p(get_gr_path(fGpu, path, stroke));
if (path.isInverseFillType()) {
GR_STATIC_CONST_SAME_STENCIL(kInvertedStencilPass,

Powered by Google App Engine
This is Rietveld 408576698