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

Side by Side Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1127273007: Iterate over instanced draws in GrGpu rather than above GrBatchTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove dead code Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrBatch.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchFontCache.h" 10 #include "GrBatchFontCache.h"
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 GrPipelineInfo init; 1831 GrPipelineInfo init;
1832 init.fColorIgnored = fBatch.fColorIgnored; 1832 init.fColorIgnored = fBatch.fColorIgnored;
1833 init.fOverrideColor = GrColor_ILLEGAL; 1833 init.fOverrideColor = GrColor_ILLEGAL;
1834 init.fCoverageIgnored = fBatch.fCoverageIgnored; 1834 init.fCoverageIgnored = fBatch.fCoverageIgnored;
1835 init.fUsesLocalCoords = this->usesLocalCoords(); 1835 init.fUsesLocalCoords = this->usesLocalCoords();
1836 gp->initBatchTracker(batchTarget->currentBatchTracker(), init); 1836 gp->initBatchTracker(batchTarget->currentBatchTracker(), init);
1837 } 1837 }
1838 1838
1839 void flush(GrBatchTarget* batchTarget, FlushInfo* flushInfo) { 1839 void flush(GrBatchTarget* batchTarget, FlushInfo* flushInfo) {
1840 GrVertices vertices; 1840 GrVertices vertices;
1841 int glyphsToFlush = flushInfo->fGlyphsToFlush;
1842 int maxGlyphsPerDraw = flushInfo->fIndexBuffer->maxQuads(); 1841 int maxGlyphsPerDraw = flushInfo->fIndexBuffer->maxQuads();
1843 vertices.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuf fer, 1842 vertices.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuf fer,
1844 flushInfo->fIndexBuffer, flushInfo->fVertexOffset , 1843 flushInfo->fIndexBuffer, flushInfo->fVertexOffset ,
1845 kVerticesPerGlyph, kIndicesPerGlyph, &glyphsToFlu sh, 1844 kVerticesPerGlyph, kIndicesPerGlyph, flushInfo->f GlyphsToFlush,
1846 maxGlyphsPerDraw); 1845 maxGlyphsPerDraw);
1847 do { 1846 batchTarget->draw(vertices);
1848 batchTarget->draw(vertices);
1849 } while (vertices.nextInstances(&glyphsToFlush, maxGlyphsPerDraw));
1850 flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlus h; 1847 flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlus h;
1851 flushInfo->fGlyphsToFlush = 0; 1848 flushInfo->fGlyphsToFlush = 0;
1852 } 1849 }
1853 1850
1854 GrColor color() const { return fBatch.fColor; } 1851 GrColor color() const { return fBatch.fColor; }
1855 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } 1852 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
1856 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 1853 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
1857 int numGlyphs() const { return fBatch.fNumGlyphs; } 1854 int numGlyphs() const { return fBatch.fNumGlyphs; }
1858 1855
1859 bool onCombineIfPossible(GrBatch* t) override { 1856 bool onCombineIfPossible(GrBatch* t) override {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 pipelineBuilder.setFromPaint(grPaint, rt, clip); 2160 pipelineBuilder.setFromPaint(grPaint, rt, clip);
2164 2161
2165 GrColor color = grPaint.getColor(); 2162 GrColor color = grPaint.getColor();
2166 for (int run = 0; run < cacheBlob->fRunCount; run++) { 2163 for (int run = 0; run < cacheBlob->fRunCount; run++) {
2167 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint); 2164 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint);
2168 } 2165 }
2169 2166
2170 // Now flush big glyphs 2167 // Now flush big glyphs
2171 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0); 2168 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0);
2172 } 2169 }
OLDNEW
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698