Remove unused texture coordinate flags.
Currently we support 5 texture stages, each with 5 possible texture coordinate attributes.
However, we only ever use one explicit texture coordinate. This change removes all but one
(now named just "aTexCoord") of the possible explicit texture coordinates.
Review URL: https://codereview.appspot.com/7308094/
git-svn-id: http://skia.googlecode.com/svn/trunk@7737 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index c00a5ce..7fc2c13 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -523,20 +523,15 @@
void GrDrawTarget::drawRect(const GrRect& rect,
const SkMatrix* matrix,
- const GrRect* srcRects[],
- const SkMatrix* srcMatrices[]) {
+ const GrRect* srcRect,
+ const SkMatrix* srcMatrix,
+ int stage) {
GrVertexLayout layout = 0;
uint32_t explicitCoordMask = 0;
- if (NULL != srcRects) {
- for (int s = 0; s < GrDrawState::kNumStages; ++s) {
- int numTC = 0;
- if (NULL != srcRects[s]) {
- layout |= GrDrawState::StageTexCoordVertexLayoutBit(s, numTC);
- explicitCoordMask |= (1 << s);
- ++numTC;
- }
- }
+ if (NULL != srcRect) {
+ layout |= GrDrawState::StageTexCoordVertexLayoutBit(stage);
+ explicitCoordMask = (1 << stage);
}
GrDrawState::AutoViewMatrixRestore avmr;
@@ -560,11 +555,11 @@
GrAssert(0 != stageOffsets[i]);
GrPoint* coords = GrTCast<GrPoint*>(GrTCast<intptr_t>(geo.vertices()) +
stageOffsets[i]);
- coords->setRectFan(srcRects[i]->fLeft, srcRects[i]->fTop,
- srcRects[i]->fRight, srcRects[i]->fBottom,
+ coords->setRectFan(srcRect->fLeft, srcRect->fTop,
+ srcRect->fRight, srcRect->fBottom,
vsize);
- if (NULL != srcMatrices && NULL != srcMatrices[i]) {
- srcMatrices[i]->mapPointsWithStride(coords, vsize, 4);
+ if (NULL != srcMatrix) {
+ srcMatrix->mapPointsWithStride(coords, vsize, 4);
}
} else {
GrAssert(0 == stageOffsets[i]);