| OLD | NEW |
| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 SkScalar weight = rand.nextRangeF(0.f, 2.f); | 243 SkScalar weight = rand.nextRangeF(0.f, 2.f); |
| 244 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { | 244 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { |
| 245 SkAutoTUnref<GrGeometryProcessor> gp; | 245 SkAutoTUnref<GrGeometryProcessor> gp; |
| 246 { // scope to contain GrTestTarget | 246 { // scope to contain GrTestTarget |
| 247 GrTestTarget tt; | 247 GrTestTarget tt; |
| 248 context->getTestTarget(&tt); | 248 context->getTestTarget(&tt); |
| 249 if (NULL == tt.target()) { | 249 if (NULL == tt.target()) { |
| 250 continue; | 250 continue; |
| 251 } | 251 } |
| 252 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; | 252 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 253 gp.reset(GrConicEffect::Create(0xff000000, et, *tt.target()-
>caps())); | 253 gp.reset(GrConicEffect::Create(0xff000000, et, *tt.target()-
>caps(), |
| 254 SkMatrix::I())); |
| 254 if (!gp) { | 255 if (!gp) { |
| 255 continue; | 256 continue; |
| 256 } | 257 } |
| 257 } | 258 } |
| 258 | 259 |
| 259 SkScalar x = SkScalarMul(col, w); | 260 SkScalar x = SkScalarMul(col, w); |
| 260 SkScalar y = SkScalarMul(row, h); | 261 SkScalar y = SkScalarMul(row, h); |
| 261 SkPoint controlPts[] = { | 262 SkPoint controlPts[] = { |
| 262 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, | 263 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 263 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, | 264 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 }; | 433 }; |
| 433 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { | 434 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { |
| 434 SkAutoTUnref<GrGeometryProcessor> gp; | 435 SkAutoTUnref<GrGeometryProcessor> gp; |
| 435 { // scope to contain GrTestTarget | 436 { // scope to contain GrTestTarget |
| 436 GrTestTarget tt; | 437 GrTestTarget tt; |
| 437 context->getTestTarget(&tt); | 438 context->getTestTarget(&tt); |
| 438 if (NULL == tt.target()) { | 439 if (NULL == tt.target()) { |
| 439 continue; | 440 continue; |
| 440 } | 441 } |
| 441 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; | 442 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 442 gp.reset(GrQuadEffect::Create(0xff000000, et, *tt.target()->
caps())); | 443 gp.reset(GrQuadEffect::Create(0xff000000, et, *tt.target()->
caps(), |
| 444 SkMatrix::I())); |
| 443 if (!gp) { | 445 if (!gp) { |
| 444 continue; | 446 continue; |
| 445 } | 447 } |
| 446 } | 448 } |
| 447 | 449 |
| 448 SkScalar x = SkScalarMul(col, w); | 450 SkScalar x = SkScalarMul(col, w); |
| 449 SkScalar y = SkScalarMul(row, h); | 451 SkScalar y = SkScalarMul(row, h); |
| 450 SkPoint controlPts[] = { | 452 SkPoint controlPts[] = { |
| 451 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, | 453 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 452 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, | 454 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 typedef GM INHERITED; | 523 typedef GM INHERITED; |
| 522 }; | 524 }; |
| 523 | 525 |
| 524 DEF_GM( return SkNEW(BezierCubicEffects); ) | 526 DEF_GM( return SkNEW(BezierCubicEffects); ) |
| 525 DEF_GM( return SkNEW(BezierConicEffects); ) | 527 DEF_GM( return SkNEW(BezierConicEffects); ) |
| 526 DEF_GM( return SkNEW(BezierQuadEffects); ) | 528 DEF_GM( return SkNEW(BezierQuadEffects); ) |
| 527 | 529 |
| 528 } | 530 } |
| 529 | 531 |
| 530 #endif | 532 #endif |
| OLD | NEW |