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

Unified Diff: src/gpu/GrBatch.cpp

Issue 1124633003: Revert of Start on simplifying generateGeometry() overrides (Closed) Base URL: https://skia.googlesource.com/skia.git@ibcache
Patch Set: Created 5 years, 8 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/GrBatch.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatch.cpp
diff --git a/src/gpu/GrBatch.cpp b/src/gpu/GrBatch.cpp
index 1ef6c9797c1f4b08e8d1b8ad945706841b2b7d00..ce30499ff8d4b4202c92170f6b5844158591355a 100644
--- a/src/gpu/GrBatch.cpp
+++ b/src/gpu/GrBatch.cpp
@@ -6,8 +6,6 @@
*/
#include "GrBatch.h"
-#include "GrBatchTarget.h"
-#include "GrResourceProvider.h"
#include "GrMemoryPool.h"
#include "SkSpinlock.h"
@@ -45,43 +43,3 @@
void GrBatch::operator delete(void* target) {
return MemoryPoolAccessor().pool()->release(target);
}
-
-void* GrBatch::InstancedHelper::init(GrBatchTarget* batchTarget, size_t vertexStride,
- const GrIndexBuffer* indexBuffer, int verticesPerInstance,
- int indicesPerInstance, int instancesToDraw) {
- SkASSERT(!fInstancesRemaining);
- SkASSERT(batchTarget);
- if (!indexBuffer) {
- return NULL;
- }
- const GrVertexBuffer* vertexBuffer;
- int firstVertex;
- int vertexCount = verticesPerInstance * instancesToDraw;
- void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, vertexCount, &vertexBuffer,
- &firstVertex);
- if (!vertices) {
- SkDebugf("Vertices could not be allocated for instanced rendering.");
- return NULL;
- }
- SkASSERT(vertexBuffer);
- fInstancesRemaining = instancesToDraw;
-
- fDrawInfo.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer,
- firstVertex, verticesPerInstance, indicesPerInstance, &fInstancesRemaining,
- indexBuffer->maxQuads());
- size_t ibSize = fDrawInfo.indexBuffer()->gpuMemorySize();
- fMaxInstancesPerDraw = static_cast<int>(ibSize / (sizeof(uint16_t) * indicesPerInstance));
- SkASSERT(fMaxInstancesPerDraw > 0);
- return vertices;
-}
-
-void* GrBatch::QuadHelper::init(GrBatchTarget* batchTarget, size_t vertexStride, int quadsToDraw) {
- SkAutoTUnref<const GrIndexBuffer> quadIndexBuffer(
- batchTarget->resourceProvider()->refQuadIndexBuffer());
- if (!quadIndexBuffer) {
- SkDebugf("Could not get quad index buffer.");
- return NULL;
- }
- return this->INHERITED::init(batchTarget, vertexStride, quadIndexBuffer, kVerticesPerQuad,
- kIndicesPerQuad, quadsToDraw);
-}
« no previous file with comments | « src/gpu/GrBatch.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698