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

Side by Side Diff: gm/beziereffects.cpp

Issue 815553003: Move ViewMatrix off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@remove-fragment-stage
Patch Set: more cleaning Created 5 years, 11 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 | gm/convexpolyeffect.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 2013 Google Inc. 3 * Copyright 2013 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 }; 85 };
86 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType ) { 86 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType ) {
87 SkAutoTUnref<GrGeometryProcessor> gp; 87 SkAutoTUnref<GrGeometryProcessor> gp;
88 { // scope to contain GrTestTarget 88 { // scope to contain GrTestTarget
89 GrTestTarget tt; 89 GrTestTarget tt;
90 context->getTestTarget(&tt); 90 context->getTestTarget(&tt);
91 if (NULL == tt.target()) { 91 if (NULL == tt.target()) {
92 continue; 92 continue;
93 } 93 }
94 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; 94 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType;
95 gp.reset(GrCubicEffect::Create(0xff000000, et, *tt.target()- >caps())); 95 gp.reset(GrCubicEffect::Create(0xff000000, SkMatrix::I(), et ,
96 *tt.target()->caps()));
96 if (!gp) { 97 if (!gp) {
97 continue; 98 continue;
98 } 99 }
99 } 100 }
100 101
101 SkScalar x = SkScalarMul(col, w); 102 SkScalar x = SkScalarMul(col, w);
102 SkScalar y = SkScalarMul(row, h); 103 SkScalar y = SkScalarMul(row, h);
103 SkPoint controlPts[] = { 104 SkPoint controlPts[] = {
104 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, 105 {x + baseControlPts[0].fX, y + baseControlPts[0].fY},
105 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, 106 {x + baseControlPts[1].fX, y + baseControlPts[1].fY},
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 SkScalar weight = rand.nextRangeF(0.f, 2.f); 244 SkScalar weight = rand.nextRangeF(0.f, 2.f);
244 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType ) { 245 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType ) {
245 SkAutoTUnref<GrGeometryProcessor> gp; 246 SkAutoTUnref<GrGeometryProcessor> gp;
246 { // scope to contain GrTestTarget 247 { // scope to contain GrTestTarget
247 GrTestTarget tt; 248 GrTestTarget tt;
248 context->getTestTarget(&tt); 249 context->getTestTarget(&tt);
249 if (NULL == tt.target()) { 250 if (NULL == tt.target()) {
250 continue; 251 continue;
251 } 252 }
252 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; 253 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType;
253 gp.reset(GrConicEffect::Create(0xff000000, et, *tt.target()- >caps(), 254 gp.reset(GrConicEffect::Create(0xff000000, SkMatrix::I(), et ,
254 SkMatrix::I())); 255 *tt.target()->caps(), SkMatri x::I()));
255 if (!gp) { 256 if (!gp) {
256 continue; 257 continue;
257 } 258 }
258 } 259 }
259 260
260 SkScalar x = SkScalarMul(col, w); 261 SkScalar x = SkScalarMul(col, w);
261 SkScalar y = SkScalarMul(row, h); 262 SkScalar y = SkScalarMul(row, h);
262 SkPoint controlPts[] = { 263 SkPoint controlPts[] = {
263 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, 264 {x + baseControlPts[0].fX, y + baseControlPts[0].fY},
264 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, 265 {x + baseControlPts[1].fX, y + baseControlPts[1].fY},
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 }; 434 };
434 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType ) { 435 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType ) {
435 SkAutoTUnref<GrGeometryProcessor> gp; 436 SkAutoTUnref<GrGeometryProcessor> gp;
436 { // scope to contain GrTestTarget 437 { // scope to contain GrTestTarget
437 GrTestTarget tt; 438 GrTestTarget tt;
438 context->getTestTarget(&tt); 439 context->getTestTarget(&tt);
439 if (NULL == tt.target()) { 440 if (NULL == tt.target()) {
440 continue; 441 continue;
441 } 442 }
442 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; 443 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType;
443 gp.reset(GrQuadEffect::Create(0xff000000, et, *tt.target()-> caps(), 444 gp.reset(GrQuadEffect::Create(0xff000000, SkMatrix::I(), et,
444 SkMatrix::I())); 445 *tt.target()->caps(), SkMatrix ::I()));
445 if (!gp) { 446 if (!gp) {
446 continue; 447 continue;
447 } 448 }
448 } 449 }
449 450
450 SkScalar x = SkScalarMul(col, w); 451 SkScalar x = SkScalarMul(col, w);
451 SkScalar y = SkScalarMul(row, h); 452 SkScalar y = SkScalarMul(row, h);
452 SkPoint controlPts[] = { 453 SkPoint controlPts[] = {
453 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, 454 {x + baseControlPts[0].fX, y + baseControlPts[0].fY},
454 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, 455 {x + baseControlPts[1].fX, y + baseControlPts[1].fY},
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 typedef GM INHERITED; 524 typedef GM INHERITED;
524 }; 525 };
525 526
526 DEF_GM( return SkNEW(BezierCubicEffects); ) 527 DEF_GM( return SkNEW(BezierCubicEffects); )
527 DEF_GM( return SkNEW(BezierConicEffects); ) 528 DEF_GM( return SkNEW(BezierConicEffects); )
528 DEF_GM( return SkNEW(BezierQuadEffects); ) 529 DEF_GM( return SkNEW(BezierQuadEffects); )
529 530
530 } 531 }
531 532
532 #endif 533 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698