| Index: src/gpu/batches/GrAtlasTextBatch.cpp
|
| diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
|
| index 654643d3399e33308011be09b474a3d78e39c933..5df787da596fa9019c1cc7f8b7a802204bbdc640 100644
|
| --- a/src/gpu/batches/GrAtlasTextBatch.cpp
|
| +++ b/src/gpu/batches/GrAtlasTextBatch.cpp
|
| @@ -97,27 +97,25 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
|
|
|
| GrMaskFormat maskFormat = this->maskFormat();
|
|
|
| - SkAutoTUnref<const GrGeometryProcessor> gp;
|
| + FlushInfo flushInfo;
|
| if (this->usesDistanceFields()) {
|
| - gp.reset(this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(),
|
| - texture));
|
| + flushInfo.fGeometryProcessor.reset(
|
| + this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(), texture));
|
| } else {
|
| GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
|
| - gp.reset(GrBitmapTextGeoProc::Create(this->color(),
|
| - texture,
|
| - params,
|
| - maskFormat,
|
| - localMatrix,
|
| - this->usesLocalCoords()));
|
| + flushInfo.fGeometryProcessor.reset(
|
| + GrBitmapTextGeoProc::Create(this->color(),
|
| + texture,
|
| + params,
|
| + maskFormat,
|
| + localMatrix,
|
| + this->usesLocalCoords()));
|
| }
|
|
|
| - FlushInfo flushInfo;
|
| flushInfo.fGlyphsToFlush = 0;
|
| - size_t vertexStride = gp->getVertexStride();
|
| + size_t vertexStride = flushInfo.fGeometryProcessor->getVertexStride();
|
| SkASSERT(vertexStride == GrAtlasTextBlob::GetVertexStride(maskFormat));
|
|
|
| - target->initDraw(gp);
|
| -
|
| int glyphCount = this->numGlyphs();
|
| const GrBuffer* vertexBuffer;
|
|
|
| @@ -141,7 +139,7 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
|
| GrFontScaler* scaler = nullptr;
|
| SkTypeface* typeface = nullptr;
|
|
|
| - GrBlobRegenHelper helper(this, target, &flushInfo, gp);
|
| + GrBlobRegenHelper helper(this, target, &flushInfo);
|
|
|
| for (int i = 0; i < fGeoCount; i++) {
|
| const Geometry& args = fGeoData[i];
|
| @@ -187,7 +185,7 @@ void GrAtlasTextBatch::flush(GrVertexBatch::Target* target, FlushInfo* flushInfo
|
| flushInfo->fIndexBuffer, flushInfo->fVertexOffset,
|
| kVerticesPerGlyph, kIndicesPerGlyph, flushInfo->fGlyphsToFlush,
|
| maxGlyphsPerDraw);
|
| - target->draw(mesh);
|
| + target->draw(flushInfo->fGeometryProcessor, mesh);
|
| flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlush;
|
| flushInfo->fGlyphsToFlush = 0;
|
| }
|
| @@ -314,5 +312,4 @@ GrGeometryProcessor* GrAtlasTextBatch::setupDfProcessor(const SkMatrix& viewMatr
|
|
|
| void GrBlobRegenHelper::flush() {
|
| fBatch->flush(fTarget, fFlushInfo);
|
| - fTarget->initDraw(fGP);
|
| }
|
|
|