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

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

Issue 1471883002: Make stencil and cover path rendering have more reasonable bounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 typedef GrNonAtomicRef INHERITED; 141 typedef GrNonAtomicRef INHERITED;
142 }; 142 };
143 143
144 // Template this if we decide to support index types other than 16bit 144 // Template this if we decide to support index types other than 16bit
145 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase { 145 class GrDrawPathRangeBatch final : public GrDrawPathBatchBase {
146 public: 146 public:
147 DEFINE_BATCH_CLASS_ID 147 DEFINE_BATCH_CLASS_ID
148 148
149 // This can't return a more abstract type because we install the stencil set tings late :( 149 // This can't return a more abstract type because we install the stencil set tings late :(
150 static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, const SkMatri x& localMatrix, 150 static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, const SkMatri x& localMatrix,
151 GrColor color, GrPathRange* range, GrPath RangeDraw* draw) { 151 GrColor color, GrPathRange* range, GrPath RangeDraw* draw,
152 return new GrDrawPathRangeBatch(viewMatrix, localMatrix, color, range, d raw); 152 const SkRect& bounds) {
153 return new GrDrawPathRangeBatch(viewMatrix, localMatrix, color, range, d raw, bounds);
153 } 154 }
154 155
155 ~GrDrawPathRangeBatch() override; 156 ~GrDrawPathRangeBatch() override;
156 157
157 const char* name() const override { return "DrawPathRange"; } 158 const char* name() const override { return "DrawPathRange"; }
158 159
159 SkString dumpInfo() const override; 160 SkString dumpInfo() const override;
160 161
161 private: 162 private:
162 inline bool isWinding() const; 163 inline bool isWinding() const;
163 164
164 GrDrawPathRangeBatch(const SkMatrix& viewMatrix, const SkMatrix& localMatrix , GrColor color, 165 GrDrawPathRangeBatch(const SkMatrix& viewMatrix, const SkMatrix& localMatrix , GrColor color,
165 GrPathRange* range, GrPathRangeDraw* draw); 166 GrPathRange* range, GrPathRangeDraw* draw, const SkRect & bounds);
166 167
167 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override; 168 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override;
168 169
169 void onPrepare(GrBatchFlushState*) override {} 170 void onPrepare(GrBatchFlushState*) override {}
170 171
171 void onDraw(GrBatchFlushState* state) override; 172 void onDraw(GrBatchFlushState* state) override;
172 173
173 typedef GrPendingIOResource<const GrPathRange, kRead_GrIOType> PendingPathRa nge; 174 typedef GrPendingIOResource<const GrPathRange, kRead_GrIOType> PendingPathRa nge;
174 typedef SkTLList<GrPathRangeDraw*, 4> DrawList; 175 typedef SkTLList<GrPathRangeDraw*, 4> DrawList;
175 PendingPathRange fPathRange; 176 PendingPathRange fPathRange;
176 DrawList fDraws; 177 DrawList fDraws;
177 int fTotalPathCount; 178 int fTotalPathCount;
178 SkMatrix fLocalMatrix; 179 SkMatrix fLocalMatrix;
179 180
180 typedef GrDrawPathBatchBase INHERITED; 181 typedef GrDrawPathBatchBase INHERITED;
181 }; 182 };
182 183
183 #endif 184 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698