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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1034273002: Add matrix constructing helpers to SkMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « gm/aarectmodes.cpp ('k') | gm/multipicturedraw.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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const SkPath* path = iter.get(); 184 const SkPath* path = iter.get();
185 SkScalar x = 0; 185 SkScalar x = 0;
186 186
187 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) { 187 for (int et = 0; et < kGrProcessorEdgeTypeCnt; ++et) {
188 GrTestTarget tt; 188 GrTestTarget tt;
189 context->getTestTarget(&tt); 189 context->getTestTarget(&tt);
190 if (NULL == tt.target()) { 190 if (NULL == tt.target()) {
191 SkDEBUGFAIL("Couldn't get Gr test target."); 191 SkDEBUGFAIL("Couldn't get Gr test target.");
192 return; 192 return;
193 } 193 }
194 SkMatrix m; 194 const SkMatrix m = SkMatrix::MakeTrans(x, y);
195 SkPath p; 195 SkPath p;
196 m.setTranslate(x, y);
197 path->transform(m, &p); 196 path->transform(m, &p);
198 197
199 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; 198 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
200 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, p)); 199 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create( edgeType, p));
201 if (!fp) { 200 if (!fp) {
202 continue; 201 continue;
203 } 202 }
204 203
205 GrPipelineBuilder pipelineBuilder; 204 GrPipelineBuilder pipelineBuilder;
206 pipelineBuilder.addCoverageProcessor(fp); 205 pipelineBuilder.addCoverageProcessor(fp);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 SkTLList<SkPath> fPaths; 283 SkTLList<SkPath> fPaths;
285 SkTLList<SkRect> fRects; 284 SkTLList<SkRect> fRects;
286 285
287 typedef GM INHERITED; 286 typedef GM INHERITED;
288 }; 287 };
289 288
290 DEF_GM( return SkNEW(ConvexPolyEffect); ) 289 DEF_GM( return SkNEW(ConvexPolyEffect); )
291 } 290 }
292 291
293 #endif 292 #endif
OLDNEW
« no previous file with comments | « gm/aarectmodes.cpp ('k') | gm/multipicturedraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698