Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: src/gpu/batches/GrAtlasTextBatch.cpp

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrAAStrokeRectBatch.cpp ('k') | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.cpp
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index 1d8d7fe143ab1e61eed45145b2e9dedd53e4e673..8b890394060da5f18d4f2df9aef291ee1f3463f1 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -116,7 +116,7 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
size_t vertexStride = gp->getVertexStride();
SkASSERT(vertexStride == GrAtlasTextBlob::GetVertexStride(maskFormat));
- target->initDraw(gp, this->pipeline());
+ target->initDraw(gp);
int glyphCount = this->numGlyphs();
const GrVertexBuffer* vertexBuffer;
@@ -180,13 +180,13 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
}
void GrAtlasTextBatch::flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const {
- GrVertices vertices;
+ GrMesh mesh;
int maxGlyphsPerDraw = flushInfo->fIndexBuffer->maxQuads();
- vertices.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
- flushInfo->fIndexBuffer, flushInfo->fVertexOffset,
- kVerticesPerGlyph, kIndicesPerGlyph, flushInfo->fGlyphsToFlush,
- maxGlyphsPerDraw);
- target->draw(vertices);
+ mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
+ flushInfo->fIndexBuffer, flushInfo->fVertexOffset,
+ kVerticesPerGlyph, kIndicesPerGlyph, flushInfo->fGlyphsToFlush,
+ maxGlyphsPerDraw);
+ target->draw(mesh);
flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlush;
flushInfo->fGlyphsToFlush = 0;
}
@@ -313,5 +313,5 @@ GrGeometryProcessor* GrAtlasTextBatch::setupDfProcessor(const SkMatrix& viewMatr
void GrBlobRegenHelper::flush() {
fBatch->flush(fTarget, fFlushInfo);
- fTarget->initDraw(fGP, fBatch->pipeline());
+ fTarget->initDraw(fGP);
}
« no previous file with comments | « src/gpu/batches/GrAAStrokeRectBatch.cpp ('k') | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698