OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrFlushToGpuDrawTarget_DEFINED | 8 #ifndef GrFlushToGpuDrawTarget_DEFINED |
9 #define GrFlushToGpuDrawTarget_DEFINED | 9 #define GrFlushToGpuDrawTarget_DEFINED |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // caller may conservatively over reserve vertices / indices. | 62 // caller may conservatively over reserve vertices / indices. |
63 // we release unused space back to allocator if possible | 63 // we release unused space back to allocator if possible |
64 // can only do this if there isn't an intervening pushGeometrySource() | 64 // can only do this if there isn't an intervening pushGeometrySource() |
65 size_t fUsedPoolVertexBytes; | 65 size_t fUsedPoolVertexBytes; |
66 size_t fUsedPoolIndexBytes; | 66 size_t fUsedPoolIndexBytes; |
67 }; | 67 }; |
68 | 68 |
69 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS
tack; | 69 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS
tack; |
70 const GeoPoolStateStack& getGeoPoolStateStack() const { return fGeoPoolState
Stack; } | 70 const GeoPoolStateStack& getGeoPoolStateStack() const { return fGeoPoolState
Stack; } |
71 | 71 |
| 72 void willReserveVertexAndIndexSpace(int vertexCount, |
| 73 size_t vertexStride, |
| 74 int indexCount) SK_OVERRIDE; |
| 75 |
72 private: | 76 private: |
73 virtual void onReset() = 0; | 77 virtual void onReset() = 0; |
74 | 78 |
75 virtual void onFlush() = 0; | 79 virtual void onFlush() = 0; |
76 | 80 |
77 void setDrawBuffers(DrawInfo*, size_t stride) SK_OVERRIDE; | 81 void setDrawBuffers(DrawInfo*, size_t stride) SK_OVERRIDE; |
78 bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertice
s) SK_OVERRIDE; | 82 bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertice
s) SK_OVERRIDE; |
79 bool onReserveIndexSpace(int indexCount, void** indices) SK_OVERRIDE; | 83 bool onReserveIndexSpace(int indexCount, void** indices) SK_OVERRIDE; |
80 void releaseReservedVertexSpace() SK_OVERRIDE; | 84 void releaseReservedVertexSpace() SK_OVERRIDE; |
81 void releaseReservedIndexSpace() SK_OVERRIDE; | 85 void releaseReservedIndexSpace() SK_OVERRIDE; |
82 void geometrySourceWillPush() SK_OVERRIDE; | 86 void geometrySourceWillPush() SK_OVERRIDE; |
83 void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRID
E; | 87 void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRID
E; |
84 void willReserveVertexAndIndexSpace(int vertexCount, | |
85 size_t vertexStride, | |
86 int indexCount) SK_OVERRIDE; | |
87 bool onCanCopySurface(const GrSurface* dst, | 88 bool onCanCopySurface(const GrSurface* dst, |
88 const GrSurface* src, | 89 const GrSurface* src, |
89 const SkIRect& srcRect, | 90 const SkIRect& srcRect, |
90 const SkIPoint& dstPoint) SK_OVERRIDE; | 91 const SkIPoint& dstPoint) SK_OVERRIDE; |
91 bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_
OVERRIDE; | 92 bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_
OVERRIDE; |
92 | 93 |
93 GeoPoolStateStack fGeoPoolStateStack; | 94 GeoPoolStateStack fGeoPoolStateStack; |
94 SkAutoTUnref<GrGpu> fGpu; | 95 SkAutoTUnref<GrGpu> fGpu; |
95 GrVertexBufferAllocPool* fVertexPool; | 96 GrVertexBufferAllocPool* fVertexPool; |
96 GrIndexBufferAllocPool* fIndexPool; | 97 GrIndexBufferAllocPool* fIndexPool; |
97 bool fFlushing; | 98 bool fFlushing; |
98 | 99 |
99 typedef GrClipTarget INHERITED; | 100 typedef GrClipTarget INHERITED; |
100 }; | 101 }; |
101 | 102 |
102 #endif | 103 #endif |
OLD | NEW |