Convert GrBufferType to enum class, rename, and remove dead values
Renamed to GrGpuBufferType in anticipation of splitting GrBuffer
into GrGpuBuffer and GrCpuBuffer types.
There were two unused values in the enum that are removed, DrawIndirect
and Texel.
Change-Id: Icb6b3da689adbd8e10495c10fd0470a6ee0120b5
Reviewed-on: https://skia-review.googlesource.com/c/189280
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrBuffer.h b/src/gpu/GrBuffer.h
index 8b0d551..128ec48 100644
--- a/src/gpu/GrBuffer.h
+++ b/src/gpu/GrBuffer.h
@@ -18,14 +18,14 @@
* Creates a client-side buffer.
*/
static SK_WARN_UNUSED_RESULT sk_sp<GrBuffer> MakeCPUBacked(GrGpu*, size_t sizeInBytes,
- GrBufferType,
+ GrGpuBufferType,
const void* data = nullptr);
/**
* Computes a scratch key for a GPU-side buffer with a "dynamic" access pattern. (Buffers with
* "static" and "stream" patterns are disqualified by nature from being cached and reused.)
*/
- static void ComputeScratchKeyForDynamicVBO(size_t size, GrBufferType, GrScratchKey*);
+ static void ComputeScratchKeyForDynamicVBO(size_t size, GrGpuBufferType, GrScratchKey*);
GrAccessPattern accessPattern() const { return fAccessPattern; }
size_t sizeInBytes() const { return fSizeInBytes; }
@@ -101,7 +101,7 @@
}
protected:
- GrBuffer(GrGpu*, size_t sizeInBytes, GrBufferType, GrAccessPattern);
+ GrBuffer(GrGpu*, size_t sizeInBytes, GrGpuBufferType, GrAccessPattern);
void* fMapPtr;
@@ -109,7 +109,7 @@
/**
* Internal constructor to make a CPU-backed buffer.
*/
- GrBuffer(GrGpu*, size_t sizeInBytes, GrBufferType, void* cpuData);
+ GrBuffer(GrGpu*, size_t sizeInBytes, GrGpuBufferType, void* cpuData);
virtual void onMap() { SkASSERT(this->isCPUBacked()); fMapPtr = fCPUData; }
virtual void onUnmap() { SkASSERT(this->isCPUBacked()); }
@@ -122,7 +122,7 @@
size_t fSizeInBytes;
GrAccessPattern fAccessPattern;
void* fCPUData;
- GrBufferType fIntendedType;
+ GrGpuBufferType fIntendedType;
typedef GrGpuResource INHERITED;
};