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

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

Issue 1131553002: Isolate GrBufferAllocPools inside GrBatchTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT 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 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 SkASSERT(vertexStride == (fUseDistanceFields ? 1519 SkASSERT(vertexStride == (fUseDistanceFields ?
1520 get_vertex_stride_df(fMaskFormat, fUseLCDText) : 1520 get_vertex_stride_df(fMaskFormat, fUseLCDText) :
1521 get_vertex_stride(fMaskFormat))); 1521 get_vertex_stride(fMaskFormat)));
1522 1522
1523 this->initDraw(batchTarget, gp, pipeline); 1523 this->initDraw(batchTarget, gp, pipeline);
1524 1524
1525 int glyphCount = this->numGlyphs(); 1525 int glyphCount = this->numGlyphs();
1526 int instanceCount = fInstanceCount; 1526 int instanceCount = fInstanceCount;
1527 const GrVertexBuffer* vertexBuffer; 1527 const GrVertexBuffer* vertexBuffer;
1528 1528
1529 void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, 1529 void* vertices = batchTarget->makeVertSpace(vertexStride,
1530 glyphCount * kVert icesPerGlyph, 1530 glyphCount * kVerticesPerGly ph,
1531 &vertexBuffer, 1531 &vertexBuffer,
1532 &flushInfo.fVertex Offset); 1532 &flushInfo.fVertexOffset);
1533 flushInfo.fVertexBuffer.reset(SkRef(vertexBuffer)); 1533 flushInfo.fVertexBuffer.reset(SkRef(vertexBuffer));
1534 flushInfo.fIndexBuffer.reset(batchTarget->resourceProvider()->refQuadInd exBuffer()); 1534 flushInfo.fIndexBuffer.reset(batchTarget->resourceProvider()->refQuadInd exBuffer());
1535 if (!vertices || !flushInfo.fVertexBuffer) { 1535 if (!vertices || !flushInfo.fVertexBuffer) {
1536 SkDebugf("Could not allocate vertices\n"); 1536 SkDebugf("Could not allocate vertices\n");
1537 return; 1537 return;
1538 } 1538 }
1539 1539
1540 unsigned char* currVertex = reinterpret_cast<unsigned char*>(vertices); 1540 unsigned char* currVertex = reinterpret_cast<unsigned char*>(vertices);
1541 1541
1542 // We cache some values to avoid going to the glyphcache for the same fo ntScaler twice 1542 // We cache some values to avoid going to the glyphcache for the same fo ntScaler twice
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 pipelineBuilder.setFromPaint(grPaint, rt, clip); 2163 pipelineBuilder.setFromPaint(grPaint, rt, clip);
2164 2164
2165 GrColor color = grPaint.getColor(); 2165 GrColor color = grPaint.getColor();
2166 for (int run = 0; run < cacheBlob->fRunCount; run++) { 2166 for (int run = 0; run < cacheBlob->fRunCount; run++) {
2167 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint); 2167 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint);
2168 } 2168 }
2169 2169
2170 // Now flush big glyphs 2170 // Now flush big glyphs
2171 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0); 2171 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0);
2172 } 2172 }
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