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

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: rebase 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
Index: src/gpu/batches/GrAtlasTextBatch.cpp
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index 1d8d7fe143ab1e61eed45145b2e9dedd53e4e673..fd8925d09401054c71d11d6747fbd3961eb89228 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, kTriangles_GrPrimitiveType);
int glyphCount = this->numGlyphs();
const GrVertexBuffer* vertexBuffer;
@@ -182,10 +182,9 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
void GrAtlasTextBatch::flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const {
GrVertices vertices;
int maxGlyphsPerDraw = flushInfo->fIndexBuffer->maxQuads();
- vertices.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
- flushInfo->fIndexBuffer, flushInfo->fVertexOffset,
- kVerticesPerGlyph, kIndicesPerGlyph, flushInfo->fGlyphsToFlush,
- maxGlyphsPerDraw);
+ vertices.initInstanced(flushInfo->fVertexBuffer, flushInfo->fIndexBuffer,
+ flushInfo->fVertexOffset, kVerticesPerGlyph, kIndicesPerGlyph,
+ flushInfo->fGlyphsToFlush, maxGlyphsPerDraw);
target->draw(vertices);
flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlush;
flushInfo->fGlyphsToFlush = 0;
@@ -313,5 +312,5 @@ GrGeometryProcessor* GrAtlasTextBatch::setupDfProcessor(const SkMatrix& viewMatr
void GrBlobRegenHelper::flush() {
fBatch->flush(fTarget, fFlushInfo);
- fTarget->initDraw(fGP, fBatch->pipeline());
+ fTarget->initDraw(fGP, kTriangles_GrPrimitiveType);
}

Powered by Google App Engine
This is Rietveld 408576698