Index: src/gpu/GrPathRenderer.h |
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h |
index 3bc02306e63f7e8b83faf2313db5bf5ca8eda8b9..1072f69649742872c85390480ed0288c5c81d899 100644 |
--- a/src/gpu/GrPathRenderer.h |
+++ b/src/gpu/GrPathRenderer.h |
@@ -10,12 +10,13 @@ |
#include "GrDrawTarget.h" |
#include "GrStencil.h" |
-#include "GrStyle.h" |
+#include "GrStrokeInfo.h" |
#include "SkDrawProcs.h" |
#include "SkTArray.h" |
class SkPath; |
+ |
struct GrPoint; |
/** |
@@ -71,14 +72,14 @@ |
* fPipelineBuilder The pipelineBuilder |
* fViewMatrix The viewMatrix |
* fPath The path to draw |
- * fStyle The styling info (path effect, stroking info) |
+ * fStroke The stroke information (width, join, cap) |
* fAntiAlias True if anti-aliasing is required. |
*/ |
struct CanDrawPathArgs { |
const GrShaderCaps* fShaderCaps; |
const SkMatrix* fViewMatrix; |
const SkPath* fPath; |
- const GrStyle* fStyle; |
+ const GrStrokeInfo* fStroke; |
bool fAntiAlias; |
// These next two are only used by GrStencilAndCoverPathRenderer |
@@ -89,7 +90,7 @@ |
SkASSERT(fShaderCaps); |
SkASSERT(fViewMatrix); |
SkASSERT(fPath); |
- SkASSERT(fStyle); |
+ SkASSERT(fStroke); |
SkASSERT(!fPath->isEmpty()); |
} |
}; |
@@ -115,7 +116,7 @@ |
* fColor Color to render with |
* fViewMatrix The viewMatrix |
* fPath the path to draw. |
- * fStyle the style information (path effect, stroke info) |
+ * fStroke the stroke information (width, join, cap) |
* fAntiAlias true if anti-aliasing is required. |
* fGammaCorrect true if gamma-correct rendering is to be used. |
*/ |
@@ -126,7 +127,7 @@ |
GrColor fColor; |
const SkMatrix* fViewMatrix; |
const SkPath* fPath; |
- const GrStyle* fStyle; |
+ const GrStrokeInfo* fStroke; |
bool fAntiAlias; |
bool fGammaCorrect; |
@@ -136,7 +137,7 @@ |
SkASSERT(fPipelineBuilder); |
SkASSERT(fViewMatrix); |
SkASSERT(fPath); |
- SkASSERT(fStyle); |
+ SkASSERT(fStroke); |
SkASSERT(!fPath->isEmpty()); |
} |
}; |
@@ -152,7 +153,7 @@ |
canArgs.fShaderCaps = args.fTarget->caps()->shaderCaps(); |
canArgs.fViewMatrix = args.fViewMatrix; |
canArgs.fPath = args.fPath; |
- canArgs.fStyle = args.fStyle; |
+ canArgs.fStroke = args.fStroke; |
canArgs.fAntiAlias = args.fAntiAlias; |
canArgs.fIsStencilDisabled = args.fPipelineBuilder->getStencil().isDisabled(); |
@@ -161,7 +162,8 @@ |
SkASSERT(this->canDrawPath(canArgs)); |
if (!args.fPipelineBuilder->getStencil().isDisabled()) { |
SkASSERT(kNoRestriction_StencilSupport == this->getStencilSupport(*args.fPath)); |
- SkASSERT(args.fStyle->isSimpleFill()); |
+ SkASSERT(!args.fStroke->isDashed()); |
+ SkASSERT(args.fStroke->isFillStyle()); |
} |
#endif |
return this->onDrawPath(args); |
@@ -195,21 +197,22 @@ |
/** |
* Draws the path to the stencil buffer. Assume the writable stencil bits are already |
* initialized to zero. The pixels inside the path will have non-zero stencil values afterwards. |
+ * |
*/ |
void stencilPath(const StencilPathArgs& args) { |
SkDEBUGCODE(args.validate();) |
SkASSERT(kNoSupport_StencilSupport != this->getStencilSupport(*args.fPath)); |
+ |
this->onStencilPath(args); |
} |
// Helper for determining if we can treat a thin stroke as a hairline w/ coverage. |
// If we can, we draw lots faster (raster device does this same test). |
- static bool IsStrokeHairlineOrEquivalent(const GrStyle& style, const SkMatrix& matrix, |
+ static bool IsStrokeHairlineOrEquivalent(const GrStrokeInfo& stroke, const SkMatrix& matrix, |
SkScalar* outCoverage) { |
- if (style.pathEffect()) { |
+ if (stroke.isDashed()) { |
return false; |
} |
- const SkStrokeRec& stroke = style.strokeRec(); |
if (stroke.isHairlineStyle()) { |
if (outCoverage) { |
*outCoverage = SK_Scalar1; |
@@ -276,12 +279,13 @@ |
drawArgs.fColor = 0xFFFFFFFF; |
drawArgs.fViewMatrix = args.fViewMatrix; |
drawArgs.fPath = args.fPath; |
- drawArgs.fStyle = &GrStyle::SimpleFill(); |
+ drawArgs.fStroke = &GrStrokeInfo::FillInfo(); |
drawArgs.fAntiAlias = false; |
drawArgs.fGammaCorrect = false; |
this->drawPath(drawArgs); |
} |
+ |
typedef SkRefCnt INHERITED; |
}; |