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

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

Issue 1967513002: Revert of Replace GrStrokeInfo with GrStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@resscale
Patch Set: Created 4 years, 7 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/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.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 9d8d07de84b1aa3a88452313eeacf3b9e67a57b3..6933efebe330744543d07a970cd93695a8fd6106 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -14,7 +14,7 @@
#include "GrPath.h"
#include "GrRenderTarget.h"
#include "GrResourceProvider.h"
-#include "GrStyle.h"
+#include "GrStrokeInfo.h"
#include "batches/GrRectBatchFactory.h"
GrPathRenderer* GrStencilAndCoverPathRenderer::Create(GrResourceProvider* resourceProvider,
@@ -31,9 +31,7 @@
}
bool GrStencilAndCoverPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
- // GrPath doesn't support hairline paths. Also, an arbitrary path effect could change
- // the style type to hairline.
- if (!args.fStyle->hasNonDashPathEffect() || args.fStyle->strokeRec().isHairlineStyle()) {
+ if (args.fStroke->isHairlineStyle()) {
return false;
}
if (!args.fIsStencilDisabled) {
@@ -47,19 +45,19 @@
}
static GrPath* get_gr_path(GrResourceProvider* resourceProvider, const SkPath& skPath,
- const GrStyle& style) {
+ const GrStrokeInfo& stroke) {
GrUniqueKey key;
bool isVolatile;
- GrPath::ComputeKey(skPath, style, &key, &isVolatile);
+ GrPath::ComputeKey(skPath, stroke, &key, &isVolatile);
SkAutoTUnref<GrPath> path(
static_cast<GrPath*>(resourceProvider->findAndRefResourceByUniqueKey(key)));
if (!path) {
- path.reset(resourceProvider->createPath(skPath, style));
+ path.reset(resourceProvider->createPath(skPath, stroke));
if (!isVolatile) {
resourceProvider->assignUniqueKeyToResource(key, path);
}
} else {
- SkASSERT(path->isEqualTo(skPath, style));
+ SkASSERT(path->isEqualTo(skPath, stroke));
}
return path.release();
}
@@ -68,14 +66,14 @@
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
"GrStencilAndCoverPathRenderer::onStencilPath");
SkASSERT(!args.fPath->isInverseFillType());
- SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, GrStyle::SimpleFill()));
+ SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fPath, GrStrokeInfo::FillInfo()));
args.fTarget->stencilPath(*args.fPipelineBuilder, *args.fViewMatrix, p, p->getFillType());
}
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),
"GrStencilAndCoverPathRenderer::onDrawPath");
- SkASSERT(!args.fStyle->strokeRec().isHairlineStyle());
+ SkASSERT(!args.fStroke->isHairlineStyle());
const SkPath& path = *args.fPath;
GrPipelineBuilder* pipelineBuilder = args.fPipelineBuilder;
const SkMatrix& viewMatrix = *args.fViewMatrix;
@@ -87,7 +85,7 @@
pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_Flag);
}
- SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, *args.fStyle));
+ SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, *args.fStroke));
if (path.isInverseFillType()) {
static constexpr GrStencilSettings kInvertedStencilPass(
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698