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

Unified Diff: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp

Issue 1504753003: Use correct fill type and bounds for NVPR paths that are stroked with Skia (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/GrPath.h ('k') | src/gpu/gl/GrGLPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index a11d2b468345120c3b499a5877aa812c016c2edd..cf5db3fc630d294686a22902a23daf3fc1a66bcd 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -16,22 +16,6 @@
#include "GrResourceProvider.h"
#include "GrStrokeInfo.h"
-/*
- * For now paths only natively support winding and even odd fill types
- */
-static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill) {
- switch (fill) {
- default:
- SkFAIL("Incomplete Switch\n");
- case SkPath::kWinding_FillType:
- case SkPath::kInverseWinding_FillType:
- return GrPathRendering::kWinding_FillType;
- case SkPath::kEvenOdd_FillType:
- case SkPath::kInverseEvenOdd_FillType:
- return GrPathRendering::kEvenOdd_FillType;
- }
-}
-
GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrResourceProvider* resourceProvider,
const GrCaps& caps) {
if (caps.shaderCaps()->pathRenderingSupport()) {
@@ -80,8 +64,7 @@ static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& s
void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
SkASSERT(!args.fPath->isInverseFillType());
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, *args.fStroke));
- args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p,
- convert_skpath_filltype(args.fPath->getFillType()));
+ args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->getFillType());
}
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -114,8 +97,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
pipelineBuilder->setStencil(kInvertedStencilPass);
// fake inverse with a stencil and cover
- args.fTarget->stencilPath(*pipelineBuilder, viewMatrix, p,
- convert_skpath_filltype(path.getFillType()));
+ args.fTarget->stencilPath(*pipelineBuilder, viewMatrix, p, p->getFillType());
SkMatrix invert = SkMatrix::I();
SkRect bounds =
@@ -149,8 +131,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
0xffff);
pipelineBuilder->setStencil(kStencilPass);
- args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p,
- convert_skpath_filltype(path.getFillType()));
+ args.fTarget->drawPath(*pipelineBuilder, viewMatrix, args.fColor, p, p->getFillType());
}
pipelineBuilder->stencil()->setDisabled();
« no previous file with comments | « src/gpu/GrPath.h ('k') | src/gpu/gl/GrGLPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698