Consolidate GPU buffer implementations
Consolidates all the different buffer implementations into a single
GrBuffer class. This will allow us to add new buffer types, use DSA in
OpenGL, track buffer bindings by unique ID, cache buffers without
respect to the type of data they have been used for previously, etc.
This change is strictly a refactor; it introduces no change in
functionality.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1825393002
Committed: https://skia.googlesource.com/skia/+/8b1bff29675afd25843439eade634a57f68fe16f
Review URL: https://codereview.chromium.org/1825393002
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 9ec8ffd..890a18b 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -28,7 +28,7 @@
static const int kVertsPerAAFillRect = 8;
static const int kIndicesPerAAFillRect = 30;
-const GrIndexBuffer* get_index_buffer(GrResourceProvider* resourceProvider) {
+const GrBuffer* get_index_buffer(GrResourceProvider* resourceProvider) {
GR_DEFINE_STATIC_UNIQUE_KEY(gAAFillRectIndexBufferKey);
static const uint16_t gFillAARectIdx[] = {
@@ -191,7 +191,7 @@
out->setUnknownSingleComponent();
}
- static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) {
+ static const GrBuffer* GetIndexBuffer(GrResourceProvider* rp) {
return get_index_buffer(rp);
}