Add fuzzer for Triangulating Path Renderer
Bug: skia:11892
Change-Id: I3f8145516f8fd23eb05c29517cd5c1553c9b1df1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399296
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrEagerVertexAllocator.h b/src/gpu/GrEagerVertexAllocator.h
index aaec828..73531f4 100644
--- a/src/gpu/GrEagerVertexAllocator.h
+++ b/src/gpu/GrEagerVertexAllocator.h
@@ -8,6 +8,7 @@
#ifndef GrEagerVertexAllocator_DEFINED
#define GrEagerVertexAllocator_DEFINED
+#include "src/gpu/GrThreadSafeCache.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
// This interface is used to allocate and map GPU vertex data before the exact number of required
@@ -87,4 +88,26 @@
int fLockCount = 0;
};
+class GrCpuVertexAllocator : public GrEagerVertexAllocator {
+public:
+ GrCpuVertexAllocator() = default;
+
+#ifdef SK_DEBUG
+ ~GrCpuVertexAllocator() override {
+ SkASSERT(!fLockStride && !fVertices && !fVertexData);
+ }
+#endif
+
+ void* lock(size_t stride, int eagerCount) override;
+ void unlock(int actualCount) override;
+
+ sk_sp<GrThreadSafeCache::VertexData> detachVertexData();
+
+private:
+ sk_sp<GrThreadSafeCache::VertexData> fVertexData;
+
+ void* fVertices = nullptr;
+ size_t fLockStride = 0;
+};
+
#endif