diff options
author | 2013-02-14 15:25:44 +0000 | |
---|---|---|
committer | 2013-02-14 15:25:44 +0000 | |
commit | 3976825a21532e254311b90b4a9046e25717e335 (patch) | |
tree | a33642b5e4db4d62c2cd24debae440794b399582 /src/gpu/GrContext.cpp | |
parent | 682e1f92455e398804f413d4c223d1d05c4ea2a1 (diff) |
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
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r-- | src/gpu/GrContext.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 70db25601f..8ca74c3d2d 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -312,7 +312,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc, GrTextureParams params(SkShader::kClamp_TileMode, needsFiltering); drawState->createTextureEffect(0, clampedTexture, SkMatrix::I(), params); - static const GrVertexLayout layout = GrDrawState::StageTexCoordVertexLayoutBit(0,0); + static const GrVertexLayout layout = GrDrawState::StageTexCoordVertexLayoutBit(0); drawState->setVertexLayout(layout); GrDrawTarget::AutoReleaseGeometry arg(fGpu, 4, 0); @@ -853,12 +853,7 @@ void GrContext::drawRectToRect(const GrPaint& paint, #else GrDrawState::AutoStageDisable atr(fDrawState); - const GrRect* srcRects[GrDrawState::kNumStages] = {NULL}; - const SkMatrix* srcMatrices[GrDrawState::kNumStages] = {NULL}; - srcRects[0] = &srcRect; - srcMatrices[0] = srcMatrix; - - target->drawRect(dstRect, dstMatrix, srcRects, srcMatrices); + target->drawRect(dstRect, dstMatrix, &srcRect, srcMatrix, 0); #endif } @@ -879,7 +874,7 @@ void GrContext::drawVertices(const GrPaint& paint, GrVertexLayout layout = 0; if (NULL != texCoords) { - layout |= GrDrawState::StageTexCoordVertexLayoutBit(0, 0); + layout |= GrDrawState::StageTexCoordVertexLayoutBit(0); } if (NULL != colors) { layout |= GrDrawState::kColor_VertexLayoutBit; @@ -892,20 +887,20 @@ void GrContext::drawVertices(const GrPaint& paint, GrPrintf("Failed to get space for vertices!\n"); return; } - int texOffsets[GrDrawState::kMaxTexCoords]; + int texOffset; int colorOffset; - GrDrawState::VertexSizeAndOffsetsByIdx(layout, - texOffsets, - &colorOffset, - NULL, - NULL); + GrDrawState::VertexSizeAndOffsets(layout, + &texOffset, + &colorOffset, + NULL, + NULL); void* curVertex = geo.vertices(); for (int i = 0; i < vertexCount; ++i) { *((GrPoint*)curVertex) = positions[i]; - if (texOffsets[0] > 0) { - *(GrPoint*)((intptr_t)curVertex + texOffsets[0]) = texCoords[i]; + if (texOffset > 0) { + *(GrPoint*)((intptr_t)curVertex + texOffset) = texCoords[i]; } if (colorOffset > 0) { *(GrColor*)((intptr_t)curVertex + colorOffset) = colors[i]; |