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

Unified Diff: src/gpu/batches/GrAADistanceFieldPathRenderer.cpp

Issue 1825393002: Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: asserts 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
« no previous file with comments | « src/gpu/batches/GrAAConvexPathRenderer.cpp ('k') | src/gpu/batches/GrAAFillRectBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index 7e96b86550981e262f109c4c61c6c994b68a2bf0..6a8ec2ff8570d0b2178a1690f7f83a566583bae0 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -10,13 +10,13 @@
#include "GrBatchFlushState.h"
#include "GrBatchTest.h"
+#include "GrBuffer.h"
#include "GrContext.h"
#include "GrPipelineBuilder.h"
#include "GrResourceProvider.h"
#include "GrSurfacePriv.h"
#include "GrSWMaskHelper.h"
#include "GrTexturePriv.h"
-#include "GrVertexBuffer.h"
#include "batches/GrVertexBatch.h"
#include "effects/GrDistanceFieldGeoProc.h"
@@ -177,8 +177,8 @@ private:
}
struct FlushInfo {
- SkAutoTUnref<const GrVertexBuffer> fVertexBuffer;
- SkAutoTUnref<const GrIndexBuffer> fIndexBuffer;
+ SkAutoTUnref<const GrBuffer> fVertexBuffer;
+ SkAutoTUnref<const GrBuffer> fIndexBuffer;
int fVertexOffset;
int fInstancesToFlush;
};
@@ -217,7 +217,7 @@ private:
size_t vertexStride = dfProcessor->getVertexStride();
SkASSERT(vertexStride == 2 * sizeof(SkPoint) + sizeof(GrColor));
- const GrVertexBuffer* vertexBuffer;
+ const GrBuffer* vertexBuffer;
void* vertices = target->makeVertexSpace(vertexStride,
kVerticesPerQuad * instanceCount,
&vertexBuffer,
@@ -492,7 +492,8 @@ private:
void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const {
GrMesh mesh;
- int maxInstancesPerDraw = flushInfo->fIndexBuffer->maxQuads();
+ int maxInstancesPerDraw =
+ static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6);
mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
flushInfo->fIndexBuffer, flushInfo->fVertexOffset, kVerticesPerQuad,
kIndicesPerQuad, flushInfo->fInstancesToFlush, maxInstancesPerDraw);
« no previous file with comments | « src/gpu/batches/GrAAConvexPathRenderer.cpp ('k') | src/gpu/batches/GrAAFillRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698