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

Unified Diff: src/gpu/GrContext.cpp

Issue 23926019: Stateful PathRenderer implementation (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add assert & patch for missing AutoPathClear Created 6 years, 10 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/GrClipMaskManager.cpp ('k') | src/gpu/GrDefaultPathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
===================================================================
--- src/gpu/GrContext.cpp (revision 13379)
+++ src/gpu/GrContext.cpp (working copy)
@@ -1148,16 +1148,18 @@
GrPathRendererChain::DrawType type =
useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType :
- GrPathRendererChain::kColor_DrawType;
+ GrPathRendererChain::kColor_DrawType;
const SkPath* pathPtr = &path;
SkTLazy<SkPath> tmpPath;
SkTCopyOnFirstWrite<SkStrokeRec> stroke(origStroke);
// Try a 1st time without stroking the path and without allowing the SW renderer
- GrPathRenderer* pr = this->getPathRenderer(*pathPtr, *stroke, target, false, type);
+ GrPathRenderer::AutoClearPath acp(this->getPathRenderer(*pathPtr, *stroke,
+ target, false, type,
+ pathPtr->getFillType()));
- if (NULL == pr) {
+ if (NULL == acp.renderer()) {
if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*stroke, this->getMatrix(), NULL)) {
// It didn't work the 1st time, so try again with the stroked path
if (stroke->applyToPath(tmpPath.init(), *pathPtr)) {
@@ -1170,17 +1172,18 @@
}
// This time, allow SW renderer
- pr = this->getPathRenderer(*pathPtr, *stroke, target, true, type);
+ acp.set(this->getPathRenderer(*pathPtr, *stroke, target, true, type,
+ pathPtr->getFillType()));
}
- if (NULL == pr) {
+ if (NULL == acp.renderer()) {
#ifdef SK_DEBUG
GrPrintf("Unable to find path renderer compatible with path.\n");
#endif
return;
}
- pr->drawPath(*pathPtr, *stroke, target, useCoverageAA);
+ acp->drawPath(*stroke, target, useCoverageAA);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1676,6 +1679,7 @@
const GrDrawTarget* target,
bool allowSW,
GrPathRendererChain::DrawType drawType,
+ SkPath::FillType fillType,
GrPathRendererChain::StencilSupport* stencilSupport) {
if (NULL == fPathRendererChain) {
@@ -1686,6 +1690,7 @@
stroke,
target,
drawType,
+ fillType,
stencilSupport);
if (NULL == pr && allowSW) {
@@ -1693,6 +1698,7 @@
fSoftwarePathRenderer = SkNEW_ARGS(GrSoftwarePathRenderer, (this));
}
pr = fSoftwarePathRenderer;
+ pr->setPath(path, fillType);
}
return pr;
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrDefaultPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698