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

Unified Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 1096513002: Pass dashing information to path rasterizers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 100-col issue 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
Index: src/gpu/GrDefaultPathRenderer.cpp
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 531b5e5f4a8128cedbb5870410078de2b7b1d00a..13eb6e4c8f8855bfa0ede8bfbeed241ebc2c32f9 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -14,6 +14,7 @@
#include "GrDefaultGeoProcFactory.h"
#include "GrPathUtils.h"
#include "GrPipelineBuilder.h"
+#include "GrStrokeInfo.h"
#include "SkGeometry.h"
#include "SkString.h"
#include "SkStrokeRec.h"
@@ -170,8 +171,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,9 +546,9 @@ 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<SkStrokeRec> stroke(origStroke.getStrokeRec());
SkScalar hairlineCoverage;
uint8_t newCoverage = 0xff;
@@ -719,12 +720,11 @@ 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,
- viewMatrix,
- NULL));
+ return !antiAlias && (stroke.getStrokeRec().isFillStyle() ||
+ IsStrokeHairlineOrEquivalent(stroke.getStrokeRec(), viewMatrix, NULL));
}
bool GrDefaultPathRenderer::onDrawPath(GrDrawTarget* target,
@@ -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);

Powered by Google App Engine
This is Rietveld 408576698