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

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

Issue 23120004: Change Atlas recycling to track current flush count and recycle if Atlas not used in current flush. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Disable font cache stats; clean up whitespace. Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 void reset(); 59 void reset();
60 60
61 /** 61 /**
62 * This plays the queued up draws to its GrGpu target. It also resets this o bject (i.e. flushing 62 * This plays the queued up draws to its GrGpu target. It also resets this o bject (i.e. flushing
63 * is destructive). This buffer must not have an active reserved vertex or i ndex source. Any 63 * is destructive). This buffer must not have an active reserved vertex or i ndex source. Any
64 * reserved geometry on the target will be finalized because it's geometry s ource will be pushed 64 * reserved geometry on the target will be finalized because it's geometry s ource will be pushed
65 * before flushing and popped afterwards. 65 * before flushing and popped afterwards.
66 */ 66 */
67 void flush(); 67 void flush();
68 68
69 // tracking for flush tokens
70 virtual FlushToken getCurrentFlushToken() { return FlushToken(this, fFlushID ); }
71 virtual bool isCurrentFlush(uint32_t flushID) { return flushID == fFlu shID; }
bsalomon 2013/08/14 19:04:27 shouldn't this be private?
jvanverth1 2013/08/15 14:49:58 Done.
72
69 // overrides from GrDrawTarget 73 // overrides from GrDrawTarget
70 virtual bool geometryHints(int* vertexCount, 74 virtual bool geometryHints(int* vertexCount,
71 int* indexCount) const SK_OVERRIDE; 75 int* indexCount) const SK_OVERRIDE;
72 virtual void clear(const SkIRect* rect, 76 virtual void clear(const SkIRect* rect,
73 GrColor color, 77 GrColor color,
74 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; 78 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE;
75 79
76 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des c) SK_OVERRIDE; 80 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des c) SK_OVERRIDE;
77 81
78
79 protected: 82 protected:
80 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE; 83 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE;
81 84
82 private: 85 private:
83 enum Cmd { 86 enum Cmd {
84 kDraw_Cmd = 1, 87 kDraw_Cmd = 1,
85 kStencilPath_Cmd = 2, 88 kStencilPath_Cmd = 2,
86 kSetState_Cmd = 3, 89 kSetState_Cmd = 3,
87 kSetClip_Cmd = 4, 90 kSetClip_Cmd = 4,
88 kClear_Cmd = 5, 91 kClear_Cmd = 5,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 int fPoolStartIndex; 219 int fPoolStartIndex;
217 // caller may conservatively over reserve vertices / indices. 220 // caller may conservatively over reserve vertices / indices.
218 // we release unused space back to allocator if possible 221 // we release unused space back to allocator if possible
219 // can only do this if there isn't an intervening pushGeometrySource() 222 // can only do this if there isn't an intervening pushGeometrySource()
220 size_t fUsedPoolVertexBytes; 223 size_t fUsedPoolVertexBytes;
221 size_t fUsedPoolIndexBytes; 224 size_t fUsedPoolIndexBytes;
222 }; 225 };
223 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; 226 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack;
224 227
225 bool fFlushing; 228 bool fFlushing;
229 uint32_t fFlushID;
226 230
227 typedef GrDrawTarget INHERITED; 231 typedef GrDrawTarget INHERITED;
228 }; 232 };
229 233
230 #endif 234 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698