Index: src/gpu/effects/GrDashingEffect.cpp |
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp |
index 46a987ba39110f96e7b674f961627ca88dd4d517..b6dbbd6e0ed19f877ca6c3c5b391e7334fe0923d 100644 |
--- a/src/gpu/effects/GrDashingEffect.cpp |
+++ b/src/gpu/effects/GrDashingEffect.cpp |
@@ -783,6 +783,8 @@ |
DashAAMode aaMode, |
const SkMatrix& localMatrix); |
+ virtual ~DashingCircleEffect(); |
+ |
const char* name() const override { return "DashingCircleEffect"; } |
const Attribute* inPosition() const { return fInPosition; } |
@@ -802,8 +804,16 @@ |
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; |
@@ -933,6 +943,12 @@ |
return SkNEW_ARGS(DashingCircleEffect, (color, aaMode, localMatrix)); |
} |
+DashingCircleEffect::~DashingCircleEffect() {} |
+ |
+void DashingCircleEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const { |
+ out->setUnknownSingleComponent(); |
+} |
+ |
void DashingCircleEffect::getGLProcessorKey(const GrBatchTracker& bt, |
const GrGLCaps& caps, |
GrProcessorKeyBuilder* b) const { |
@@ -955,10 +971,26 @@ |
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); |
@@ -999,6 +1031,8 @@ |
DashAAMode aaMode, |
const SkMatrix& localMatrix); |
+ virtual ~DashingLineEffect(); |
+ |
const char* name() const override { return "DashingEffect"; } |
const Attribute* inPosition() const { return fInPosition; } |
@@ -1018,8 +1052,16 @@ |
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; |
@@ -1161,6 +1203,12 @@ |
return SkNEW_ARGS(DashingLineEffect, (color, aaMode, localMatrix)); |
} |
+DashingLineEffect::~DashingLineEffect() {} |
+ |
+void DashingLineEffect::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const { |
+ out->setUnknownSingleComponent(); |
+} |
+ |
void DashingLineEffect::getGLProcessorKey(const GrBatchTracker& bt, |
const GrGLCaps& caps, |
GrProcessorKeyBuilder* b) const { |
@@ -1182,10 +1230,26 @@ |
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); |