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

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

Issue 1831133004: Revert of Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrTInstanceBatch.h ('k') | src/gpu/batches/GrTestBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrTessellatingPathRenderer.cpp
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp
index 4ba01884dc318e30c2089475a8a47683c9099853..c00e8ecbe69ee17148c1ca5fca521adf66b1bc3f 100644
--- a/src/gpu/batches/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp
@@ -45,7 +45,7 @@
}
};
-bool cache_match(GrBuffer* vertexBuffer, SkScalar tol, int* actualCount) {
+bool cache_match(GrVertexBuffer* vertexBuffer, SkScalar tol, int* actualCount) {
if (!vertexBuffer) {
return false;
}
@@ -68,8 +68,8 @@
}
SkPoint* lock(int vertexCount) override {
size_t size = vertexCount * sizeof(SkPoint);
- fVertexBuffer.reset(fResourceProvider->createBuffer(
- kVertex_GrBufferType, size, kStatic_GrAccessPattern, 0));
+ fVertexBuffer.reset(fResourceProvider->createVertexBuffer(
+ size, GrResourceProvider::kStatic_BufferUsage, 0));
if (!fVertexBuffer.get()) {
return nullptr;
}
@@ -89,9 +89,9 @@
}
fVertices = nullptr;
}
- GrBuffer* vertexBuffer() { return fVertexBuffer.get(); }
+ GrVertexBuffer* vertexBuffer() { return fVertexBuffer.get(); }
private:
- SkAutoTUnref<GrBuffer> fVertexBuffer;
+ SkAutoTUnref<GrVertexBuffer> fVertexBuffer;
GrResourceProvider* fResourceProvider;
bool fCanMapVB;
SkPoint* fVertices;
@@ -158,7 +158,8 @@
fStroke.asUniqueKeyFragment(&builder[2 + clipBoundsSize32]);
builder.finish();
GrResourceProvider* rp = target->resourceProvider();
- SkAutoTUnref<GrBuffer> cachedVertexBuffer(rp->findAndRefTByUniqueKey<GrBuffer>(key));
+ SkAutoTUnref<GrVertexBuffer> cachedVertexBuffer(
+ rp->findAndRefTByUniqueKey<GrVertexBuffer>(key));
int actualCount;
SkScalar screenSpaceTol = GrPathUtils::kDefaultTolerance;
SkScalar tol = GrPathUtils::scaleToleranceToSrc(
@@ -225,7 +226,7 @@
this->draw(target, gp.get());
}
- void drawVertices(Target* target, const GrGeometryProcessor* gp, const GrBuffer* vb,
+ void drawVertices(Target* target, const GrGeometryProcessor* gp, const GrVertexBuffer* vb,
int firstVertex, int count) const {
SkASSERT(gp->getVertexStride() == sizeof(SkPoint));
« no previous file with comments | « src/gpu/batches/GrTInstanceBatch.h ('k') | src/gpu/batches/GrTestBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698