diff options
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r-- | src/gpu/GrDrawTarget.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index 6fdc3a080f..cd4d4d2007 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -529,11 +529,9 @@ void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type, void GrDrawTarget::drawRect(const GrRect& rect, const SkMatrix* matrix, - const GrRect* srcRect, - const SkMatrix* srcMatrix, - int stage) { + const GrRect* localRect, + const SkMatrix* localMatrix) { GrAttribBindings bindings = 0; - uint32_t explicitCoordMask = 0; // position + (optional) texture coord static const GrVertexAttrib kAttribs[] = { {kVec2f_GrVertexAttribType, 0}, @@ -541,16 +539,15 @@ void GrDrawTarget::drawRect(const GrRect& rect, }; int attribCount = 1; - if (NULL != srcRect) { - bindings |= GrDrawState::ExplicitTexCoordAttribBindingsBit(stage); + if (NULL != localRect) { + bindings |= GrDrawState::kLocalCoords_AttribBindingsBit; attribCount = 2; - this->drawState()->setAttribIndex(GrDrawState::kTexCoord_AttribIndex, 1); - explicitCoordMask = (1 << stage); + this->drawState()->setAttribIndex(GrDrawState::kLocalCoords_AttribIndex, 1); } GrDrawState::AutoViewMatrixRestore avmr; if (NULL != matrix) { - avmr.set(this->drawState(), *matrix, explicitCoordMask); + avmr.set(this->drawState(), *matrix); } this->drawState()->setVertexAttribs(kAttribs, attribCount); @@ -564,15 +561,15 @@ void GrDrawTarget::drawRect(const GrRect& rect, size_t vsize = this->drawState()->getVertexSize(); geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vsize); - if (NULL != srcRect) { + if (NULL != localRect) { GrAssert(attribCount == 2); GrPoint* coords = GrTCast<GrPoint*>(GrTCast<intptr_t>(geo.vertices()) + kAttribs[1].fOffset); - coords->setRectFan(srcRect->fLeft, srcRect->fTop, - srcRect->fRight, srcRect->fBottom, - vsize); - if (NULL != srcMatrix) { - srcMatrix->mapPointsWithStride(coords, vsize, 4); + coords->setRectFan(localRect->fLeft, localRect->fTop, + localRect->fRight, localRect->fBottom, + vsize); + if (NULL != localMatrix) { + localMatrix->mapPointsWithStride(coords, vsize, 4); } } |