diff options
author | 2015-04-28 09:08:28 -0700 | |
---|---|---|
committer | 2015-04-28 09:08:28 -0700 | |
commit | ef292a0901205b9785a30daae2c036aa34a970ca (patch) | |
tree | 78df6b75ca04153409353aa488ce193bcf91de9b /src/gpu/effects/GrBitmapTextGeoProc.cpp | |
parent | cfc18867d982119d9dc2888bf09f1093012daadd (diff) |
removing equality / compute invariant loops from GrGeometryProcessors
BUG=skia:
Review URL: https://codereview.chromium.org/1111603004
Diffstat (limited to 'src/gpu/effects/GrBitmapTextGeoProc.cpp')
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.cpp | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp index 7cce1df201..15747cf11d 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp @@ -118,8 +118,8 @@ private: GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, const GrTextureParams& params, GrMaskFormat format, - bool opaqueVertexColors, const SkMatrix& localMatrix) - : INHERITED(color, SkMatrix::I(), localMatrix, opaqueVertexColors) + const SkMatrix& localMatrix) + : INHERITED(color, SkMatrix::I(), localMatrix) , fTextureAccess(texture, params) , fInColor(NULL) , fMaskFormat(format) { @@ -129,40 +129,12 @@ GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; if (hasVertexColor) { fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType)); - this->setHasVertexColor(); } fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", kVec2s_GrVertexAttribType)); this->addTextureAccess(&fTextureAccess); } -bool GrBitmapTextGeoProc::onIsEqual(const GrGeometryProcessor& other) const { - const GrBitmapTextGeoProc& gp = other.cast<GrBitmapTextGeoProc>(); - return SkToBool(this->inColor()) == SkToBool(gp.inColor()); -} - -void GrBitmapTextGeoProc::onGetInvariantOutputColor(GrInitInvariantOutput* out) const { - if (kARGB_GrMaskFormat == fMaskFormat) { - out->setUnknownFourComponents(); - } -} - -void GrBitmapTextGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const { - if (kARGB_GrMaskFormat != fMaskFormat) { - if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { - out->setUnknownSingleComponent(); - } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { - out->setUnknownOpaqueFourComponents(); - out->setUsingLCDCoverage(); - } else { - out->setUnknownFourComponents(); - out->setUsingLCDCoverage(); - } - } else { - out->setKnownSingleComponent(0xff); - } -} - void GrBitmapTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const { @@ -182,17 +154,6 @@ void GrBitmapTextGeoProc::initBatchTracker(GrBatchTracker* bt, const GrPipelineI local->fUsesLocalCoords = init.fUsesLocalCoords; } -bool GrBitmapTextGeoProc::onCanMakeEqual(const GrBatchTracker& m, - const GrGeometryProcessor& that, - const GrBatchTracker& t) const { - const BitmapTextBatchTracker& mine = m.cast<BitmapTextBatchTracker>(); - const BitmapTextBatchTracker& theirs = t.cast<BitmapTextBatchTracker>(); - return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords, - that, theirs.fUsesLocalCoords) && - CanCombineOutput(mine.fInputColorType, mine.fColor, - theirs.fInputColorType, theirs.fColor); -} - /////////////////////////////////////////////////////////////////////////////// GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc); @@ -231,6 +192,5 @@ GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(SkRandom* random, } return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params, - format, random->nextBool(), - GrProcessorUnitTest::TestMatrix(random)); + format, GrProcessorUnitTest::TestMatrix(random)); } |