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

Side by Side Diff: src/gpu/GrInOrderDrawBuffer.h

Issue 184443003: Add Gpu Tracing to Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added files Created 6 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 unified diff | Download patch
OLDNEW
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 GrSurface* src, 161 GrSurface* src,
162 const SkIRect& srcRect, 162 const SkIRect& srcRect,
163 const SkIPoint& dstPoint) SK_OVERRIDE; 163 const SkIPoint& dstPoint) SK_OVERRIDE;
164 virtual bool onCanCopySurface(GrSurface* dst, 164 virtual bool onCanCopySurface(GrSurface* dst,
165 GrSurface* src, 165 GrSurface* src,
166 const SkIRect& srcRect, 166 const SkIRect& srcRect,
167 const SkIPoint& dstPoint) SK_OVERRIDE; 167 const SkIPoint& dstPoint) SK_OVERRIDE;
168 168
169 bool quickInsideClip(const SkRect& devBounds); 169 bool quickInsideClip(const SkRect& devBounds);
170 170
171 virtual void onInstantGpuTraceEvent(const char* marker) SK_OVERRIDE; 171 virtual void didAddGpuTraceMarker() SK_OVERRIDE {};
bsalomon 2014/03/20 16:32:53 don't need ;s
172 virtual void onPushGpuTraceEvent(const char* marker) SK_OVERRIDE; 172 virtual void didRemoveGpuTraceMarker() SK_OVERRIDE {};
173 virtual void onPopGpuTraceEvent() SK_OVERRIDE;
174
175 173
176 // Attempts to concat instances from info onto the previous draw. info must represent an 174 // Attempts to concat instances from info onto the previous draw. info must represent an
177 // instanced draw. The caller must have already recorded a new draw state an d clip if necessary. 175 // instanced draw. The caller must have already recorded a new draw state an d clip if necessary.
178 int concatInstancedDraw(const DrawInfo& info); 176 int concatInstancedDraw(const DrawInfo& info);
179 177
180 // we lazily record state and clip changes in order to skip clips and states that have no 178 // we lazily record state and clip changes in order to skip clips and states that have no
181 // effect. 179 // effect.
182 bool needsNewState() const; 180 bool needsNewState() const;
183 bool needsNewClip() const; 181 bool needsNewClip() const;
184 182
(...skipping 21 matching lines...) Expand all
206 204
207 SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds; 205 SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds;
208 GrSTAllocator<kDrawPreallocCnt, DrawRecord> fDraws; 206 GrSTAllocator<kDrawPreallocCnt, DrawRecord> fDraws;
209 GrSTAllocator<kStatePreallocCnt, StencilPath> fStencilP aths; 207 GrSTAllocator<kStatePreallocCnt, StencilPath> fStencilP aths;
210 GrSTAllocator<kStatePreallocCnt, DrawPath> fDrawPath s; 208 GrSTAllocator<kStatePreallocCnt, DrawPath> fDrawPath s;
211 GrSTAllocator<kStatePreallocCnt, GrDrawState::DeferredState> fStates; 209 GrSTAllocator<kStatePreallocCnt, GrDrawState::DeferredState> fStates;
212 GrSTAllocator<kClearPreallocCnt, Clear> fClears; 210 GrSTAllocator<kClearPreallocCnt, Clear> fClears;
213 GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurf aces; 211 GrSTAllocator<kCopySurfacePreallocCnt, CopySurface> fCopySurf aces;
214 GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips; 212 GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips;
215 GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrig ins; 213 GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrig ins;
214 SkTArray<GrTraceMarkerSet, false> fGpuCmdMa rkers;
216 215
217 GrDrawTarget* fDstGpu; 216 GrDrawTarget* fDstGpu;
218 217
219 bool fClipSet; 218 bool fClipSet;
220 219
221 enum ClipProxyState { 220 enum ClipProxyState {
222 kUnknown_ClipProxyState, 221 kUnknown_ClipProxyState,
223 kValid_ClipProxyState, 222 kValid_ClipProxyState,
224 kInvalid_ClipProxyState 223 kInvalid_ClipProxyState
225 }; 224 };
(...skipping 12 matching lines...) Expand all
238 // caller may conservatively over reserve vertices / indices. 237 // caller may conservatively over reserve vertices / indices.
239 // we release unused space back to allocator if possible 238 // we release unused space back to allocator if possible
240 // can only do this if there isn't an intervening pushGeometrySource() 239 // can only do this if there isn't an intervening pushGeometrySource()
241 size_t fUsedPoolVertexBytes; 240 size_t fUsedPoolVertexBytes;
242 size_t fUsedPoolIndexBytes; 241 size_t fUsedPoolIndexBytes;
243 }; 242 };
244 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; 243 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack;
245 244
246 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; } 245 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; }
247 246
247 void addToCmdBuffer(uint8_t cmd);
248
248 bool fFlushing; 249 bool fFlushing;
249 uint32_t fDrawID; 250 uint32_t fDrawID;
250 251
251 typedef GrDrawTarget INHERITED; 252 typedef GrDrawTarget INHERITED;
252 }; 253 };
253 254
254 #endif 255 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698