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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1447113002: Optionally pass rendertarget to getTestTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « gm/constcolorprocessor.cpp ('k') | gm/rrects.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 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 // This test only works with the GPU backend. 9 // This test only works with the GPU backend.
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 SkScalar y = 0; 168 SkScalar y = 0;
169 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I terStart); 169 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I terStart);
170 iter.get(); 170 iter.get();
171 iter.next()) { 171 iter.next()) {
172 const SkPath* path = iter.get(); 172 const SkPath* path = iter.get();
173 SkScalar x = 0; 173 SkScalar x = 0;
174 174
175 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { 175 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
176 GrTestTarget tt; 176 GrTestTarget tt;
177 context->getTestTarget(&tt); 177 context->getTestTarget(&tt, rt);
178 if (nullptr == tt.target()) { 178 if (nullptr == tt.target()) {
179 SkDEBUGFAIL("Couldn't get Gr test target."); 179 SkDEBUGFAIL("Couldn't get Gr test target.");
180 return; 180 return;
181 } 181 }
182 const SkMatrix m = SkMatrix::MakeTrans(x, y); 182 const SkMatrix m = SkMatrix::MakeTrans(x, y);
183 SkPath p; 183 SkPath p;
184 path->transform(m, &p); 184 path->transform(m, &p);
185 185
186 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; 186 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
187 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, p)); 187 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, p));
(...skipping 30 matching lines...) Expand all
218 } 218 }
219 219
220 for (SkTLList<SkRect>::Iter iter(fRects, SkTLList<SkRect>::Iter::kHead_I terStart); 220 for (SkTLList<SkRect>::Iter iter(fRects, SkTLList<SkRect>::Iter::kHead_I terStart);
221 iter.get(); 221 iter.get();
222 iter.next()) { 222 iter.next()) {
223 223
224 SkScalar x = 0; 224 SkScalar x = 0;
225 225
226 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { 226 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
227 GrTestTarget tt; 227 GrTestTarget tt;
228 context->getTestTarget(&tt); 228 context->getTestTarget(&tt, rt);
229 if (nullptr == tt.target()) { 229 if (nullptr == tt.target()) {
230 SkDEBUGFAIL("Couldn't get Gr test target."); 230 SkDEBUGFAIL("Couldn't get Gr test target.");
231 return; 231 return;
232 } 232 }
233 SkRect rect = *iter.get(); 233 SkRect rect = *iter.get();
234 rect.offset(x, y); 234 rect.offset(x, y);
235 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; 235 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
236 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, rect)); 236 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, rect));
237 if (!fp) { 237 if (!fp) {
238 continue; 238 continue;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 SkTLList<SkPath> fPaths; 271 SkTLList<SkPath> fPaths;
272 SkTLList<SkRect> fRects; 272 SkTLList<SkRect> fRects;
273 273
274 typedef GM INHERITED; 274 typedef GM INHERITED;
275 }; 275 };
276 276
277 DEF_GM(return new ConvexPolyEffect;) 277 DEF_GM(return new ConvexPolyEffect;)
278 } 278 }
279 279
280 #endif 280 #endif
OLDNEW
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698