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

Unified Diff: src/gpu/effects/GrDashingEffect.cpp

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: Created 6 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/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDashingEffect.cpp
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 1641d272fcc1f607009f081a23083b5f27989628..b59b2a6e5cecba57c2625c0633eeaad01df22852 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -335,7 +335,7 @@
devIntervals[0] = lineLength;
}
- SkAutoTUnref<const GrGeometryProcessor> gp;
+ const GrGeometryProcessor* gp;
bool fullDash = devIntervals[1] > 0.f || useAA;
if (fullDash) {
SkPathEffect::DashInfo devInfo;
@@ -347,11 +347,13 @@
bool isRoundCap = SkPaint::kRound_Cap == cap;
GrDashingEffect::DashCap capType = isRoundCap ? GrDashingEffect::kRound_DashCap :
GrDashingEffect::kNonRound_DashCap;
- gp.reset(GrDashingEffect::Create(color, edgeType, devInfo, strokeWidth, capType));
+ gp = GrDashingEffect::Create(color, edgeType, devInfo, strokeWidth, capType);
} else {
// Set up the vertex data for the line and start/end dashes
- gp.reset(GrDefaultGeoProcFactory::Create(color, GrDefaultGeoProcFactory::kPosition_GPType));
- }
+ gp = GrDefaultGeoProcFactory::Create(color, GrDefaultGeoProcFactory::kPosition_GPType);
+ }
+
+ drawState->setGeometryProcessor(gp)->unref();
int totalRectCnt = 0;
@@ -433,7 +435,7 @@
}
target->setIndexSourceToBuffer(gpu->getContext()->getQuadIndexBuffer());
- target->drawIndexedInstances(drawState, gp, kTriangles_GrPrimitiveType, totalRectCnt, 4, 6);
+ target->drawIndexedInstances(drawState, kTriangles_GrPrimitiveType, totalRectCnt, 4, 6);
target->resetIndexSource();
return true;
}
@@ -487,7 +489,7 @@
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;
- virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const SK_OVERRIDE;
+ virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE;
GrPrimitiveEdgeType fEdgeType;
const GrAttribute* fInPosition;
@@ -612,8 +614,8 @@
DashingCircleEffect::~DashingCircleEffect() {}
-void DashingCircleEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownSingleComponent();
+void DashingCircleEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
+ inout->mulByUnknownAlpha();
}
void DashingCircleEffect::getGLProcessorKey(const GrBatchTracker& bt,
@@ -717,7 +719,7 @@
virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE;
- virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const SK_OVERRIDE;
+ virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE;
GrPrimitiveEdgeType fEdgeType;
const GrAttribute* fInPosition;
@@ -855,8 +857,8 @@
DashingLineEffect::~DashingLineEffect() {}
-void DashingLineEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownSingleComponent();
+void DashingLineEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
+ inout->mulByUnknownAlpha();
}
void DashingLineEffect::getGLProcessorKey(const GrBatchTracker& bt,
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.h ('k') | src/gpu/effects/GrDistanceFieldTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698