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

Side by Side Diff: src/gpu/batches/GrDrawPathBatch.h

Issue 1334753002: Fix leak of path ranges (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 GrDrawPathBatch_DEFINED 8 #ifndef GrDrawPathBatch_DEFINED
9 #define GrDrawPathBatch_DEFINED 9 #define GrDrawPathBatch_DEFINED
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 const uint16_t* indices() const { return fIndices.begin(); } 109 const uint16_t* indices() const { return fIndices.begin(); }
110 110
111 const GrPathRange* range() const { return fPathRange.get(); } 111 const GrPathRange* range() const { return fPathRange.get(); }
112 112
113 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) { 113 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) {
114 return a.transformType() == b.transformType() && a.range() == b.range(); 114 return a.transformType() == b.transformType() && a.range() == b.range();
115 } 115 }
116 116
117 private: 117 private:
118 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve Cnt) 118 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve Cnt)
119 : fPathRange(SkRef(range)) 119 : fPathRange(range)
120 , fTransformType(transformType) 120 , fTransformType(transformType)
121 , fIndices(reserveCnt) 121 , fIndices(reserveCnt)
122 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT ype)) { 122 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT ype)) {
123 SkDEBUGCODE(fUsedInBatch = false;) 123 SkDEBUGCODE(fUsedInBatch = false;)
124 } 124 }
125 125
126 // Reserve space for 64 paths where indices are 16 bit and transforms are tr anslations. 126 // Reserve space for 64 paths where indices are 16 bit and transforms are tr anslations.
127 static const int kIndexReserveCnt = 64; 127 static const int kIndexReserveCnt = 64;
128 static const int kTransformBufferReserveCnt = 2 * 64; 128 static const int kTransformBufferReserveCnt = 2 * 64;
129 129
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 void onDraw(GrBatchFlushState* state) override; 168 void onDraw(GrBatchFlushState* state) override;
169 169
170 typedef SkTLList<GrPathRangeDraw*> DrawList; 170 typedef SkTLList<GrPathRangeDraw*> DrawList;
171 DrawList fDraws; 171 DrawList fDraws;
172 int fTotalPathCount; 172 int fTotalPathCount;
173 173
174 typedef GrDrawPathBatchBase INHERITED; 174 typedef GrDrawPathBatchBase INHERITED;
175 }; 175 };
176 176
177 #endif 177 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698