Add GrDrawTarget::drawIndexedInstance, use in default text context.
Review URL: http://codereview.appspot.com/5848064/
git-svn-id: http://skia.googlecode.com/svn/trunk@3444 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDefaultTextContext.cpp b/src/gpu/GrDefaultTextContext.cpp
index a0747b7..d2c5d92 100644
--- a/src/gpu/GrDefaultTextContext.cpp
+++ b/src/gpu/GrDefaultTextContext.cpp
@@ -33,7 +33,6 @@
GrSamplerState::kRepeat_WrapMode,filter);
GrAssert(GrIsALIGN4(fCurrVertex));
- int nIndices = fCurrVertex + (fCurrVertex >> 1);
GrAssert(fCurrTexture);
drawState->setTexture(kGlyphMaskStage, fCurrTexture);
@@ -56,9 +55,10 @@
}
fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer());
-
- fDrawTarget->drawIndexed(kTriangles_PrimitiveType,
- 0, 0, fCurrVertex, nIndices);
+ int nGlyphs = fCurrVertex / 4;
+ fDrawTarget->drawIndexedInstances(kTriangles_PrimitiveType,
+ nGlyphs,
+ 4, 6);
fVertices = NULL;
this->INHERITED::reset();
}