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

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

Issue 1382013002: Make path range loading explicit (Closed) Base URL: https://skia.googlesource.com/skia.git@upload4_cache
Patch Set: Fix clang build Created 5 years, 2 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 | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 int count() const { return fIndices.count(); } 108 int count() const { return fIndices.count(); }
109 109
110 TransformType transformType() const { return fTransformType; } 110 TransformType transformType() const { return fTransformType; }
111 111
112 const float* transforms() const { return fTransforms.begin(); } 112 const float* transforms() const { return fTransforms.begin(); }
113 113
114 const uint16_t* indices() const { return fIndices.begin(); } 114 const uint16_t* indices() const { return fIndices.begin(); }
115 115
116 const GrPathRange* range() const { return fPathRange.get(); } 116 const GrPathRange* range() const { return fPathRange.get(); }
117 117
118 void loadGlyphPathsIfNeeded() {
119 fPathRange.get()->loadPathsIfNeeded<uint16_t>(fIndices.begin(), fIndices .count());
120 }
121
118 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) { 122 static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) {
119 return a.transformType() == b.transformType() && a.range() == b.range(); 123 return a.transformType() == b.transformType() && a.range() == b.range();
120 } 124 }
121 125
122 private: 126 private:
123 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve Cnt) 127 GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserve Cnt)
124 : fPathRange(range) 128 : fPathRange(range)
125 , fTransformType(transformType) 129 , fTransformType(transformType)
126 , fIndices(reserveCnt) 130 , fIndices(reserveCnt)
127 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT ype)) { 131 , fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformT ype)) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 181
178 typedef SkTLList<GrPathRangeDraw*> DrawList; 182 typedef SkTLList<GrPathRangeDraw*> DrawList;
179 DrawList fDraws; 183 DrawList fDraws;
180 int fTotalPathCount; 184 int fTotalPathCount;
181 SkMatrix fLocalMatrix; 185 SkMatrix fLocalMatrix;
182 186
183 typedef GrDrawPathBatchBase INHERITED; 187 typedef GrDrawPathBatchBase INHERITED;
184 }; 188 };
185 189
186 #endif 190 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698