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

Unified Diff: src/gpu/GrFlushToGpuDrawTarget.h

Issue 1105263002: Remove vertex/index buffer factilities from GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@josh
Patch Set: rebase Created 5 years, 8 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/GrDrawTarget.cpp ('k') | src/gpu/GrFlushToGpuDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFlushToGpuDrawTarget.h
diff --git a/src/gpu/GrFlushToGpuDrawTarget.h b/src/gpu/GrFlushToGpuDrawTarget.h
index fa0ff4aa9cb2096125560382a87bb334d1a939dc..426a7c42d77382c9c6639b74538c274427261fa4 100644
--- a/src/gpu/GrFlushToGpuDrawTarget.h
+++ b/src/gpu/GrFlushToGpuDrawTarget.h
@@ -24,8 +24,6 @@ class GrFlushToGpuDrawTarget : public GrClipTarget {
public:
GrFlushToGpuDrawTarget(GrGpu*, GrVertexBufferAllocPool*,GrIndexBufferAllocPool*);
- ~GrFlushToGpuDrawTarget() override;
-
/**
* Empties the draw buffer of any queued up draws. This must not be called while inside an
* unbalanced pushGeometrySource().
@@ -40,58 +38,24 @@ public:
*/
void flush();
- bool geometryHints(size_t vertexStride, int* vertexCount, int* indexCount) const override;
-
protected:
GrGpu* getGpu() { return fGpu; }
const GrGpu* getGpu() const{ return fGpu; }
- GrVertexBufferAllocPool* getVertexAllocPool() { return fVertexPool; }
+ GrVertexBufferAllocPool* getVertexAllocPool() { return fVertexPool; }
GrIndexBufferAllocPool* getIndexAllocPool() { return fIndexPool; }
- // TODO all of this goes away when batch is everywhere
- enum {
- kGeoPoolStatePreAllocCnt = 4,
- };
-
- struct GeometryPoolState {
- const GrVertexBuffer* fPoolVertexBuffer;
- int fPoolStartVertex;
- const GrIndexBuffer* fPoolIndexBuffer;
- int fPoolStartIndex;
- // caller may conservatively over reserve vertices / indices.
- // we release unused space back to allocator if possible
- // can only do this if there isn't an intervening pushGeometrySource()
- size_t fUsedPoolVertexBytes;
- size_t fUsedPoolIndexBytes;
- };
-
- typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateStack;
- const GeoPoolStateStack& getGeoPoolStateStack() const { return fGeoPoolStateStack; }
-
- void willReserveVertexAndIndexSpace(int vertexCount,
- size_t vertexStride,
- int indexCount) override;
-
private:
virtual void onReset() = 0;
virtual void onFlush() = 0;
- void setDrawBuffers(DrawInfo*, size_t stride) override;
- bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) override;
- bool onReserveIndexSpace(int indexCount, void** indices) override;
- void releaseReservedVertexSpace() override;
- void releaseReservedIndexSpace() override;
- void geometrySourceWillPush() override;
- void geometrySourceWillPop(const GeometrySrcState& restoredState) override;
bool onCanCopySurface(const GrSurface* dst,
const GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) override;
bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) override;
- GeoPoolStateStack fGeoPoolStateStack;
SkAutoTUnref<GrGpu> fGpu;
GrVertexBufferAllocPool* fVertexPool;
GrIndexBufferAllocPool* fIndexPool;
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrFlushToGpuDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698