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

Unified Diff: src/gpu/GrBufferAllocPool.h

Issue 1825393002: Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: asserts 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/GrBuffer.h ('k') | src/gpu/GrBufferAllocPool.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBufferAllocPool.h
diff --git a/src/gpu/GrBufferAllocPool.h b/src/gpu/GrBufferAllocPool.h
index a3d8e45364295cc0e55f58684373ee0e61b76e9b..071b00b064afba135a1b536911146df1f0027d58 100644
--- a/src/gpu/GrBufferAllocPool.h
+++ b/src/gpu/GrBufferAllocPool.h
@@ -11,8 +11,9 @@
#include "SkTArray.h"
#include "SkTDArray.h"
#include "SkTypes.h"
+#include "GrTypesPriv.h"
-class GrGeometryBuffer;
+class GrBuffer;
class GrGpu;
/**
@@ -47,16 +48,6 @@ public:
protected:
/**
- * Used to determine what type of buffers to create. We could make the
- * createBuffer a virtual except that we want to use it in the cons for
- * pre-allocated buffers.
- */
- enum BufferType {
- kVertex_BufferType,
- kIndex_BufferType,
- };
-
- /**
* Constructor
*
* @param gpu The GrGpu used to create the buffers.
@@ -66,7 +57,7 @@ protected:
* reasonable minimum.
*/
GrBufferAllocPool(GrGpu* gpu,
- BufferType bufferType,
+ GrBufferType bufferType,
size_t bufferSize = 0);
virtual ~GrBufferAllocPool();
@@ -92,15 +83,15 @@ protected:
*/
void* makeSpace(size_t size,
size_t alignment,
- const GrGeometryBuffer** buffer,
+ const GrBuffer** buffer,
size_t* offset);
- GrGeometryBuffer* getBuffer(size_t size);
+ GrBuffer* getBuffer(size_t size);
private:
struct BufferBlock {
- size_t fBytesFree;
- GrGeometryBuffer* fBuffer;
+ size_t fBytesFree;
+ GrBuffer* fBuffer;
};
bool createBlock(size_t requestSize);
@@ -115,16 +106,14 @@ private:
GrGpu* fGpu;
size_t fMinBlockSize;
- BufferType fBufferType;
+ GrBufferType fBufferType;
SkTArray<BufferBlock> fBlocks;
void* fCpuData;
void* fBufferPtr;
- size_t fGeometryBufferMapThreshold;
+ size_t fBufferMapThreshold;
};
-class GrVertexBuffer;
-
/**
* A GrBufferAllocPool of vertex buffers
*/
@@ -160,15 +149,13 @@ public:
*/
void* makeSpace(size_t vertexSize,
int vertexCount,
- const GrVertexBuffer** buffer,
+ const GrBuffer** buffer,
int* startVertex);
private:
typedef GrBufferAllocPool INHERITED;
};
-class GrIndexBuffer;
-
/**
* A GrBufferAllocPool of index buffers
*/
@@ -200,7 +187,7 @@ public:
* @return pointer to first index.
*/
void* makeSpace(int indexCount,
- const GrIndexBuffer** buffer,
+ const GrBuffer** buffer,
int* startIndex);
private:
« no previous file with comments | « src/gpu/GrBuffer.h ('k') | src/gpu/GrBufferAllocPool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698