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

Unified Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 1100073003: Extract gpu line dashing to GrDashLinePathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 8 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
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 65daa7ca892364dc8e2c873898d1f7b67e1811d5..88834bb80c4c8e8a2520188ec889992ab24450d0 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -170,8 +170,8 @@ GrPathRenderer::StencilSupport
GrDefaultPathRenderer::onGetStencilSupport(const GrDrawTarget*,
const GrPipelineBuilder*,
const SkPath& path,
- const SkStrokeRec& stroke) const {
- if (single_pass_path(path, stroke)) {
+ const GrStrokeInfo& stroke) const {
+ if (single_pass_path(path, stroke.getStrokeRec())) {
return GrPathRenderer::kNoRestriction_StencilSupport;
} else {
return GrPathRenderer::kStencilOnly_StencilSupport;
@@ -545,21 +545,21 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
GrColor color,
const SkMatrix& viewMatrix,
const SkPath& path,
- const SkStrokeRec& origStroke,
+ const GrStrokeInfo& origStroke,
bool stencilOnly) {
- SkTCopyOnFirstWrite<SkStrokeRec> stroke(origStroke);
+ SkTCopyOnFirstWrite<GrStrokeInfo> stroke(origStroke);
SkScalar hairlineCoverage;
uint8_t newCoverage = 0xff;
if (IsStrokeHairlineOrEquivalent(*stroke, viewMatrix, &hairlineCoverage)) {
newCoverage = SkScalarRoundToInt(hairlineCoverage * 0xff);
- if (!stroke->isHairlineStyle()) {
- stroke.writable()->setHairlineStyle();
+ if (!stroke->getStrokeRec().isHairlineStyle()) {
+ stroke.writable()->getStrokeRecPtr()->setHairlineStyle();
}
}
- const bool isHairline = stroke->isHairlineStyle();
+ const bool isHairline = stroke->getStrokeRec().isHairlineStyle();
// Save the current xp on the draw state so we can reset it if needed
SkAutoTUnref<const GrXPFactory> backupXPFactory(SkRef(pipelineBuilder->getXPFactory()));
@@ -582,7 +582,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
lastPassIsBounds = false;
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
} else {
- if (single_pass_path(path, *stroke)) {
+ if (single_pass_path(path, stroke->getStrokeRec())) {
passCount = 1;
if (stencilOnly) {
passes[0] = &gDirectToStencil;
@@ -719,7 +719,7 @@ bool GrDefaultPathRenderer::canDrawPath(const GrDrawTarget* target,
const GrPipelineBuilder* pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& path,
- const SkStrokeRec& stroke,
+ const GrStrokeInfo& stroke,
bool antiAlias) const {
// this class can draw any path with any fill but doesn't do any anti-aliasing.
return !antiAlias && (stroke.isFillStyle() || IsStrokeHairlineOrEquivalent(stroke,
@@ -732,7 +732,7 @@ bool GrDefaultPathRenderer::onDrawPath(GrDrawTarget* target,
GrColor color,
const SkMatrix& viewMatrix,
const SkPath& path,
- const SkStrokeRec& stroke,
+ const GrStrokeInfo& stroke,
bool antiAlias) {
return this->internalDrawPath(target,
pipelineBuilder,
@@ -747,7 +747,7 @@ void GrDefaultPathRenderer::onStencilPath(GrDrawTarget* target,
GrPipelineBuilder* pipelineBuilder,
const SkMatrix& viewMatrix,
const SkPath& path,
- const SkStrokeRec& stroke) {
+ const GrStrokeInfo& stroke) {
SkASSERT(SkPath::kInverseEvenOdd_FillType != path.getFillType());
SkASSERT(SkPath::kInverseWinding_FillType != path.getFillType());
this->internalDrawPath(target, pipelineBuilder, GrColor_WHITE, viewMatrix, path, stroke, 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