OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrInOrderDrawBuffer_DEFINED | 8 #ifndef GrInOrderDrawBuffer_DEFINED |
9 #define GrInOrderDrawBuffer_DEFINED | 9 #define GrInOrderDrawBuffer_DEFINED |
10 | 10 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 DrawRecord* recordDraw(const DrawInfo&); | 205 DrawRecord* recordDraw(const DrawInfo&); |
206 StencilPath* recordStencilPath(); | 206 StencilPath* recordStencilPath(); |
207 DrawPath* recordDrawPath(); | 207 DrawPath* recordDrawPath(); |
208 DrawPaths* recordDrawPaths(); | 208 DrawPaths* recordDrawPaths(); |
209 Clear* recordClear(); | 209 Clear* recordClear(); |
210 CopySurface* recordCopySurface(); | 210 CopySurface* recordCopySurface(); |
211 | 211 |
212 // TODO: Use a single allocator for commands and records | 212 // TODO: Use a single allocator for commands and records |
213 enum { | 213 enum { |
214 kCmdPreallocCnt = 32, | 214 kCmdPreallocCnt = 32, |
215 kDrawPreallocCnt = 8, | 215 kDrawPreallocCnt = 16, |
216 kStencilPathPreallocCnt = 8, | 216 kStencilPathPreallocCnt = 8, |
217 kDrawPathPreallocCnt = 8, | 217 kDrawPathPreallocCnt = 8, |
218 kDrawPathsPreallocCnt = 8, | 218 kDrawPathsPreallocCnt = 8, |
219 kStatePreallocCnt = 8, | 219 kStatePreallocCnt = 8, |
220 kClipPreallocCnt = 8, | 220 kClipPreallocCnt = 8, |
221 kClearPreallocCnt = 4, | 221 kClearPreallocCnt = 8, |
222 kGeoPoolStatePreAllocCnt = 4, | 222 kGeoPoolStatePreAllocCnt = 4, |
223 kCopySurfacePreallocCnt = 4, | 223 kCopySurfacePreallocCnt = 4, |
224 }; | 224 }; |
225 | 225 |
226 SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds; | 226 typedef GrTAllocator<DrawRecord> DrawAllocator; |
| 227 typedef GrTAllocator<StencilPath> StencilPathAllocator
; |
| 228 typedef GrTAllocator<DrawPath> DrawPathAllocator; |
| 229 typedef GrTAllocator<DrawPaths> DrawPathsAllocator; |
| 230 typedef GrTAllocator<GrDrawState::DeferredState> StateAllocator; |
| 231 typedef GrTAllocator<Clear> ClearAllocator; |
| 232 typedef GrTAllocator<CopySurface> CopySurfaceAllocator
; |
| 233 typedef GrTAllocator<SkClipStack> ClipAllocator; |
| 234 typedef GrTAllocator<SkIPoint> ClipOriginAllocator; |
| 235 |
227 GrSTAllocator<kDrawPreallocCnt, DrawRecord> fDraws; | 236 GrSTAllocator<kDrawPreallocCnt, DrawRecord> fDraws; |
228 GrSTAllocator<kStencilPathPreallocCnt, StencilPath> fStencilP
aths; | 237 GrSTAllocator<kStencilPathPreallocCnt, StencilPath> fStencilP
aths; |
229 GrSTAllocator<kDrawPathPreallocCnt, DrawPath> fDrawPath
; | 238 GrSTAllocator<kDrawPathPreallocCnt, DrawPath> fDrawPath
; |
230 GrSTAllocator<kDrawPathsPreallocCnt, DrawPaths> fDrawPath
s; | 239 GrSTAllocator<kDrawPathsPreallocCnt, DrawPaths> fDrawPath
s; |
231 GrSTAllocator<kStatePreallocCnt, GrDrawState::DeferredState> fStates; | 240 GrSTAllocator<kStatePreallocCnt, GrDrawState::DeferredState> fStates; |
232 GrSTAllocator<kClearPreallocCnt, Clear> fClears; | 241 GrSTAllocator<kClearPreallocCnt, Clear> fClears; |
233 GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurf
aces; | 242 GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurf
aces; |
234 GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips; | 243 GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips; |
235 GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrig
ins; | 244 GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrig
ins; |
| 245 |
236 SkTArray<GrTraceMarkerSet, false> fGpuCmdMa
rkers; | 246 SkTArray<GrTraceMarkerSet, false> fGpuCmdMa
rkers; |
237 | 247 |
| 248 SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds; |
| 249 |
238 GrDrawTarget* fDstGpu; | 250 GrDrawTarget* fDstGpu; |
239 | 251 |
240 bool fClipSet; | 252 bool fClipSet; |
241 | 253 |
242 enum ClipProxyState { | 254 enum ClipProxyState { |
243 kUnknown_ClipProxyState, | 255 kUnknown_ClipProxyState, |
244 kValid_ClipProxyState, | 256 kValid_ClipProxyState, |
245 kInvalid_ClipProxyState | 257 kInvalid_ClipProxyState |
246 }; | 258 }; |
247 ClipProxyState fClipProxyState; | 259 ClipProxyState fClipProxyState; |
(...skipping 20 matching lines...) Expand all Loading... |
268 | 280 |
269 void addToCmdBuffer(uint8_t cmd); | 281 void addToCmdBuffer(uint8_t cmd); |
270 | 282 |
271 bool fFlushing; | 283 bool fFlushing; |
272 uint32_t fDrawID; | 284 uint32_t fDrawID; |
273 | 285 |
274 typedef GrDrawTarget INHERITED; | 286 typedef GrDrawTarget INHERITED; |
275 }; | 287 }; |
276 | 288 |
277 #endif | 289 #endif |
OLD | NEW |