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

Unified Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 142543007: Revert of r13384 (Stateful PathRenderer implementation) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: 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/GrDefaultPathRenderer.h ('k') | src/gpu/GrPathRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultPathRenderer.cpp
===================================================================
--- src/gpu/GrDefaultPathRenderer.cpp (revision 13407)
+++ src/gpu/GrDefaultPathRenderer.cpp (working copy)
@@ -163,9 +163,10 @@
}
GrPathRenderer::StencilSupport GrDefaultPathRenderer::onGetStencilSupport(
+ const SkPath& path,
const SkStrokeRec& stroke,
const GrDrawTarget*) const {
- if (single_pass_path(this->path(), stroke)) {
+ if (single_pass_path(path, stroke)) {
return GrPathRenderer::kNoRestriction_StencilSupport;
} else {
return GrPathRenderer::kStencilOnly_StencilSupport;
@@ -324,7 +325,8 @@
return true;
}
-bool GrDefaultPathRenderer::internalDrawPath(const SkStrokeRec& origStroke,
+bool GrDefaultPathRenderer::internalDrawPath(const SkPath& path,
+ const SkStrokeRec& origStroke,
GrDrawTarget* target,
bool stencilOnly) {
@@ -344,13 +346,13 @@
}
SkScalar tol = SK_Scalar1;
- tol = GrPathUtils::scaleToleranceToSrc(tol, viewM, this->path().getBounds());
+ tol = GrPathUtils::scaleToleranceToSrc(tol, viewM, path.getBounds());
int vertexCnt;
int indexCnt;
GrPrimitiveType primType;
GrDrawTarget::AutoReleaseGeometry arg;
- if (!this->createGeom(this->path(),
+ if (!this->createGeom(path,
*stroke,
tol,
target,
@@ -384,7 +386,7 @@
lastPassIsBounds = false;
drawFace[0] = GrDrawState::kBoth_DrawFace;
} else {
- if (single_pass_path(this->path(), *stroke)) {
+ if (single_pass_path(path, *stroke)) {
passCount = 1;
if (stencilOnly) {
passes[0] = &gDirectToStencil;
@@ -394,7 +396,7 @@
drawFace[0] = GrDrawState::kBoth_DrawFace;
lastPassIsBounds = false;
} else {
- switch (this->path().getFillType()) {
+ switch (path.getFillType()) {
case SkPath::kInverseEvenOdd_FillType:
reverse = true;
// fallthrough
@@ -461,7 +463,7 @@
}
SkRect devBounds;
- GetPathDevBounds(this->path(), drawState->getRenderTarget(), viewM, &devBounds);
+ GetPathDevBounds(path, drawState->getRenderTarget(), viewM, &devBounds);
for (int p = 0; p < passCount; ++p) {
drawState->setDrawFace(drawFace[p]);
@@ -488,7 +490,7 @@
avmr.setIdentity(drawState);
}
} else {
- bounds = this->path().getBounds();
+ bounds = path.getBounds();
}
GrDrawTarget::AutoGeometryAndStatePush agasp(target, GrDrawTarget::kPreserve_ASRInit);
target->drawSimpleRect(bounds, NULL);
@@ -507,7 +509,8 @@
return true;
}
-bool GrDefaultPathRenderer::canDrawPath(const SkStrokeRec& stroke,
+bool GrDefaultPathRenderer::canDrawPath(const SkPath& path,
+ const SkStrokeRec& stroke,
const GrDrawTarget* target,
bool antiAlias) const {
// this class can draw any path with any fill but doesn't do any anti-aliasing.
@@ -517,15 +520,20 @@
IsStrokeHairlineOrEquivalent(stroke, target->getDrawState().getViewMatrix(), NULL));
}
-bool GrDefaultPathRenderer::onDrawPath(const SkStrokeRec& stroke,
+bool GrDefaultPathRenderer::onDrawPath(const SkPath& path,
+ const SkStrokeRec& stroke,
GrDrawTarget* target,
bool antiAlias) {
- return this->internalDrawPath(stroke, target, false);
+ return this->internalDrawPath(path,
+ stroke,
+ target,
+ false);
}
-void GrDefaultPathRenderer::onStencilPath(const SkStrokeRec& stroke,
+void GrDefaultPathRenderer::onStencilPath(const SkPath& path,
+ const SkStrokeRec& stroke,
GrDrawTarget* target) {
- SkASSERT(SkPath::kInverseEvenOdd_FillType != this->path().getFillType());
- SkASSERT(SkPath::kInverseWinding_FillType != this->path().getFillType());
- this->internalDrawPath(stroke, target, true);
+ SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType());
+ SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType());
+ this->internalDrawPath(path, stroke, target, true);
}
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.h ('k') | src/gpu/GrPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698