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

Unified Diff: src/gpu/GrPathRenderer.h

Issue 1291803006: Simplify parameters passed to path renderers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: white space changes Created 5 years, 4 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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrPathRendererChain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRenderer.h
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index e353d6876fc1669129a646864fea4adcfeef8f95..4de638c6a5651e3119ca9df503535f677063b3e5 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -77,21 +77,17 @@ public:
* This function is to get the stencil support for a particular path. The path's fill must
* not be an inverse type.
*
- * @param target target that the path will be rendered to
* @param path the path that will be drawn
* @param stroke the stroke information (width, join, cap).
*/
- StencilSupport getStencilSupport(const GrDrawTarget* target,
- const GrPipelineBuilder* pipelineBuilder,
- const SkPath& path,
- const GrStrokeInfo& stroke) const {
+ StencilSupport getStencilSupport(const SkPath& path, const GrStrokeInfo& stroke) const {
SkASSERT(!path.isInverseFillType());
- return this->onGetStencilSupport(target, pipelineBuilder, path, stroke);
+ return this->onGetStencilSupport(path, stroke);
}
/** Args to canDrawPath()
*
- * fTarget The target that the path will be rendered to
+ * fShaderCaps The shader caps
* fPipelineBuilder The pipelineBuilder
* fViewMatrix The viewMatrix
* fPath The path to draw
@@ -99,8 +95,8 @@ public:
* fAntiAlias True if anti-aliasing is required.
*/
struct CanDrawPathArgs {
- const GrDrawTarget* fTarget;
- const GrPipelineBuilder* fPipelineBuilder;
+ SkAutoTUnref<const GrShaderCaps> fShaderCaps;
bsalomon 2015/08/13 13:49:35 I don't think we need the ref/unref for this. We a
robertphillips 2015/08/13 14:57:00 Done.
+ const GrPipelineBuilder* fPipelineBuilder;// only used by GrStencilAndCoverPathRenderer
const SkMatrix* fViewMatrix;
const SkPath* fPath;
const GrStrokeInfo* fStroke;
@@ -115,7 +111,7 @@ public:
* @return true if the path can be drawn by this object, false otherwise.
*/
bool canDrawPath(const CanDrawPathArgs& args) const {
- SkASSERT(args.fTarget);
+ SkASSERT(args.fShaderCaps);
SkASSERT(args.fPipelineBuilder);
SkASSERT(args.fViewMatrix);
SkASSERT(args.fPath);
@@ -160,7 +156,7 @@ public:
SkASSERT(!args.fPath->isEmpty());
#ifdef SK_DEBUG
CanDrawPathArgs canArgs;
- canArgs.fTarget = args.fTarget;
+ canArgs.fShaderCaps.reset(SkRef(args.fTarget->caps()->shaderCaps()));
canArgs.fPipelineBuilder = args.fPipelineBuilder;
canArgs.fViewMatrix = args.fViewMatrix;
canArgs.fPath = args.fPath;
@@ -168,9 +164,7 @@ public:
canArgs.fAntiAlias = args.fAntiAlias;
SkASSERT(this->canDrawPath(canArgs));
SkASSERT(args.fPipelineBuilder->getStencil().isDisabled() ||
- kNoRestriction_StencilSupport == this->getStencilSupport(args.fTarget,
- args.fPipelineBuilder,
- *args.fPath,
+ kNoRestriction_StencilSupport == this->getStencilSupport(*args.fPath,
*args.fStroke));
#endif
return this->onDrawPath(args);
@@ -206,9 +200,7 @@ public:
SkASSERT(args.fPath);
SkASSERT(args.fStroke);
SkASSERT(!args.fPath->isEmpty());
- SkASSERT(kNoSupport_StencilSupport !=
- this->getStencilSupport(args.fTarget, args.fPipelineBuilder, *args.fPath,
- *args.fStroke));
+ SkASSERT(kNoSupport_StencilSupport != this->getStencilSupport(*args.fPath, *args.fStroke));
this->onStencilPath(args);
}
@@ -250,10 +242,7 @@ private:
/**
* Subclass overrides if it has any limitations of stenciling support.
*/
- virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
- const GrPipelineBuilder*,
- const SkPath&,
- const GrStrokeInfo&) const {
+ virtual StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const {
return kNoRestriction_StencilSupport;
}
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrPathRendererChain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698