Index: src/gpu/GrDrawTarget.cpp |
=================================================================== |
--- src/gpu/GrDrawTarget.cpp (revision 8241) |
+++ src/gpu/GrDrawTarget.cpp (working copy) |
@@ -529,11 +529,9 @@ |
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 @@ |
}; |
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 @@ |
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); |
} |
} |