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

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

Issue 1111603004: removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: tweaks Created 5 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/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.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 1ca56487c2f7eb8e2860e2437f8e966611328eca..d3df886bd46c5f625be61dbb1f20b109eafbfc9c 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -773,8 +773,6 @@ public:
DashAAMode aaMode,
const SkMatrix& localMatrix);
- virtual ~DashingCircleEffect();
-
const char* name() const override { return "DashingCircleEffect"; }
const Attribute* inPosition() const { return fInPosition; }
@@ -794,17 +792,9 @@ public:
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
- bool onCanMakeEqual(const GrBatchTracker&,
- const GrGeometryProcessor&,
- const GrBatchTracker&) const override;
-
private:
DashingCircleEffect(GrColor, DashAAMode aaMode, const SkMatrix& localMatrix);
- bool onIsEqual(const GrGeometryProcessor& other) const override;
-
- void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const override;
-
DashAAMode fAAMode;
const Attribute* fInPosition;
const Attribute* fInDashParams;
@@ -933,12 +923,6 @@ GrGeometryProcessor* DashingCircleEffect::Create(GrColor color,
return SkNEW_ARGS(DashingCircleEffect, (color, aaMode, localMatrix));
}
-DashingCircleEffect::~DashingCircleEffect() {}
-
-void DashingCircleEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownSingleComponent();
-}
-
void DashingCircleEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
@@ -961,28 +945,12 @@ DashingCircleEffect::DashingCircleEffect(GrColor color,
kVec2f_GrVertexAttribType));
}
-bool DashingCircleEffect::onIsEqual(const GrGeometryProcessor& other) const {
- const DashingCircleEffect& dce = other.cast<DashingCircleEffect>();
- return fAAMode == dce.fAAMode;
-}
-
void DashingCircleEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const {
DashingCircleBatchTracker* local = bt->cast<DashingCircleBatchTracker>();
local->fInputColorType = GetColorInputType(&local->fColor, this->color(), init, false);
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
-bool DashingCircleEffect::onCanMakeEqual(const GrBatchTracker& m,
- const GrGeometryProcessor& that,
- const GrBatchTracker& t) const {
- const DashingCircleBatchTracker& mine = m.cast<DashingCircleBatchTracker>();
- const DashingCircleBatchTracker& theirs = t.cast<DashingCircleBatchTracker>();
- return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
- that, theirs.fUsesLocalCoords) &&
- CanCombineOutput(mine.fInputColorType, mine.fColor,
- theirs.fInputColorType, theirs.fColor);
-}
-
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect);
GrGeometryProcessor* DashingCircleEffect::TestCreate(SkRandom* random,
@@ -1021,8 +989,6 @@ public:
DashAAMode aaMode,
const SkMatrix& localMatrix);
- virtual ~DashingLineEffect();
-
const char* name() const override { return "DashingEffect"; }
const Attribute* inPosition() const { return fInPosition; }
@@ -1042,17 +1008,9 @@ public:
void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const override;
- bool onCanMakeEqual(const GrBatchTracker&,
- const GrGeometryProcessor&,
- const GrBatchTracker&) const override;
-
private:
DashingLineEffect(GrColor, DashAAMode aaMode, const SkMatrix& localMatrix);
- bool onIsEqual(const GrGeometryProcessor& other) const override;
-
- void onGetInvariantOutputCoverage(GrInitInvariantOutput*) const override;
-
DashAAMode fAAMode;
const Attribute* fInPosition;
const Attribute* fInDashParams;
@@ -1193,12 +1151,6 @@ GrGeometryProcessor* DashingLineEffect::Create(GrColor color,
return SkNEW_ARGS(DashingLineEffect, (color, aaMode, localMatrix));
}
-DashingLineEffect::~DashingLineEffect() {}
-
-void DashingLineEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownSingleComponent();
-}
-
void DashingLineEffect::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
@@ -1220,28 +1172,12 @@ DashingLineEffect::DashingLineEffect(GrColor color,
fInRectParams = &this->addVertexAttrib(Attribute("inRect", kVec4f_GrVertexAttribType));
}
-bool DashingLineEffect::onIsEqual(const GrGeometryProcessor& other) const {
- const DashingLineEffect& de = other.cast<DashingLineEffect>();
- return fAAMode == de.fAAMode;
-}
-
void DashingLineEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const {
DashingLineBatchTracker* local = bt->cast<DashingLineBatchTracker>();
local->fInputColorType = GetColorInputType(&local->fColor, this->color(), init, false);
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
-bool DashingLineEffect::onCanMakeEqual(const GrBatchTracker& m,
- const GrGeometryProcessor& that,
- const GrBatchTracker& t) const {
- const DashingLineBatchTracker& mine = m.cast<DashingLineBatchTracker>();
- const DashingLineBatchTracker& theirs = t.cast<DashingLineBatchTracker>();
- return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
- that, theirs.fUsesLocalCoords) &&
- CanCombineOutput(mine.fInputColorType, mine.fColor,
- theirs.fInputColorType, theirs.fColor);
-}
-
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect);
GrGeometryProcessor* DashingLineEffect::TestCreate(SkRandom* random,
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698