Track GL buffer state based on unique resource ID

Reworks GrGLGpu to track GL buffer state based on the unique
GrGpuResource ID. This eliminates the need to notify the gpu object
whenever a buffer is deleted.

This change also allows us to remove the type specifier from GrBuffer.
At this point a buffer is just a chunk of memory, and the type
given at creation time is just a suggestion to the GL backend about
which target to bind to for updates.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1854283004

Committed: https://skia.googlesource.com/skia/+/deacc97bc63513b5eacaf21f858727f6e8b98ce5

Review URL: https://codereview.chromium.org/1854283004
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 238276d..4c60f07 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -32,7 +32,7 @@
     size_t bufferSize = patternSize * reps * sizeof(uint16_t);
 
     // This is typically used in GrBatchs, so we assume kNoPendingIO.
-    GrBuffer* buffer = this->createBuffer(kIndex_GrBufferType, bufferSize, kStatic_GrAccessPattern,
+    GrBuffer* buffer = this->createBuffer(bufferSize, kIndex_GrBufferType, kStatic_GrAccessPattern,
                                           kNoPendingIO_Flag);
     if (!buffer) {
         return nullptr;
@@ -88,7 +88,7 @@
     return this->gpu()->pathRendering()->createGlyphs(tf, desc, stroke);
 }
 
-GrBuffer* GrResourceProvider::createBuffer(GrBufferType type, size_t size,
+GrBuffer* GrResourceProvider::createBuffer(size_t size, GrBufferType intendedType,
                                            GrAccessPattern accessPattern, uint32_t flags) {
     if (this->isAbandoned()) {
         return nullptr;
@@ -100,7 +100,7 @@
         size = SkTMax(MIN_SIZE, GrNextPow2(SkToUInt(size)));
 
         GrScratchKey key;
-        GrBuffer::ComputeScratchKeyForDynamicBuffer(type, size, &key);
+        GrBuffer::ComputeScratchKeyForDynamicBuffer(size, intendedType, &key);
         uint32_t scratchFlags = 0;
         if (flags & kNoPendingIO_Flag) {
             scratchFlags = GrResourceCache::kRequireNoPendingIO_ScratchFlag;
@@ -112,7 +112,7 @@
             return static_cast<GrBuffer*>(resource);
         }
     }
-    return this->gpu()->createBuffer(type, size, accessPattern);
+    return this->gpu()->createBuffer(size, intendedType, accessPattern);
 }
 
 GrBatchAtlas* GrResourceProvider::createAtlas(GrPixelConfig config,