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

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

Issue 1124733004: Move DrawInfo out from GrDrawTarget and rename to GrVertices. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment changes 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/GrBatch.h ('k') | src/gpu/GrBatchTarget.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 7
8 #include "GrBatch.h" 8 #include "GrBatch.h"
9 #include "GrBatchTarget.h" 9 #include "GrBatchTarget.h"
10 #include "GrResourceProvider.h" 10 #include "GrResourceProvider.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 &firstVertex); 62 &firstVertex);
63 if (!vertices) { 63 if (!vertices) {
64 SkDebugf("Vertices could not be allocated for instanced rendering."); 64 SkDebugf("Vertices could not be allocated for instanced rendering.");
65 return NULL; 65 return NULL;
66 } 66 }
67 SkASSERT(vertexBuffer); 67 SkASSERT(vertexBuffer);
68 fInstancesRemaining = instancesToDraw; 68 fInstancesRemaining = instancesToDraw;
69 size_t ibSize = indexBuffer->gpuMemorySize(); 69 size_t ibSize = indexBuffer->gpuMemorySize();
70 fMaxInstancesPerDraw = static_cast<int>(ibSize / (sizeof(uint16_t) * indices PerInstance)); 70 fMaxInstancesPerDraw = static_cast<int>(ibSize / (sizeof(uint16_t) * indices PerInstance));
71 71
72 fDrawInfo.initInstanced(primType, vertexBuffer, indexBuffer, 72 fVertices.initInstanced(primType, vertexBuffer, indexBuffer,
73 firstVertex, verticesPerInstance, indicesPerInstance, &fInstancesRemaini ng, 73 firstVertex, verticesPerInstance, indicesPerInstance, &fInstancesRemaini ng,
74 fMaxInstancesPerDraw); 74 fMaxInstancesPerDraw);
75 SkASSERT(fMaxInstancesPerDraw > 0); 75 SkASSERT(fMaxInstancesPerDraw > 0);
76 return vertices; 76 return vertices;
77 } 77 }
78 78
79 void* GrBatch::QuadHelper::init(GrBatchTarget* batchTarget, size_t vertexStride, int quadsToDraw) { 79 void* GrBatch::QuadHelper::init(GrBatchTarget* batchTarget, size_t vertexStride, int quadsToDraw) {
80 SkAutoTUnref<const GrIndexBuffer> quadIndexBuffer( 80 SkAutoTUnref<const GrIndexBuffer> quadIndexBuffer(
81 batchTarget->resourceProvider()->refQuadIndexBuffer()); 81 batchTarget->resourceProvider()->refQuadIndexBuffer());
82 if (!quadIndexBuffer) { 82 if (!quadIndexBuffer) {
83 SkDebugf("Could not get quad index buffer."); 83 SkDebugf("Could not get quad index buffer.");
84 return NULL; 84 return NULL;
85 } 85 }
86 return this->INHERITED::init(batchTarget, kTriangles_GrPrimitiveType, vertex Stride, 86 return this->INHERITED::init(batchTarget, kTriangles_GrPrimitiveType, vertex Stride,
87 quadIndexBuffer, kVerticesPerQuad, kIndicesPerQ uad, quadsToDraw); 87 quadIndexBuffer, kVerticesPerQuad, kIndicesPerQ uad, quadsToDraw);
88 } 88 }
OLDNEW
« no previous file with comments | « src/gpu/GrBatch.h ('k') | src/gpu/GrBatchTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698