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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 static GrBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo, | 40 static GrBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo, |
41 const SkScalar klmEqs[9], SkScalar sign) { | 41 const SkScalar klmEqs[9], SkScalar sign) { |
42 return SkNEW_ARGS(BezierCubicOrConicTestBatch, (gp, geo, klmEqs, sign)); | 42 return SkNEW_ARGS(BezierCubicOrConicTestBatch, (gp, geo, klmEqs, sign)); |
43 } | 43 } |
44 | 44 |
45 private: | 45 private: |
46 BezierCubicOrConicTestBatch(const GrGeometryProcessor* gp, const Geometry& g
eo, | 46 BezierCubicOrConicTestBatch(const GrGeometryProcessor* gp, const Geometry& g
eo, |
47 const SkScalar klmEqs[9], SkScalar sign) | 47 const SkScalar klmEqs[9], SkScalar sign) |
48 : INHERITED(gp, geo.fBounds) { | 48 : INHERITED(gp, geo.fBounds) { |
49 this->initClassID<BezierCubicOrConicTestBatch>(); | |
50 for (int i = 0; i < 9; i++) { | 49 for (int i = 0; i < 9; i++) { |
51 fKlmEqs[i] = klmEqs[i]; | 50 fKlmEqs[i] = klmEqs[i]; |
52 } | 51 } |
53 | 52 |
54 fGeometry = geo; | 53 fGeometry = geo; |
55 fSign = sign; | 54 fSign = sign; |
56 } | 55 } |
57 | 56 |
58 struct Vertex { | 57 struct Vertex { |
59 SkPoint fPosition; | 58 SkPoint fPosition; |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 const GrPathUtils::QuadUVMatrix& devToUV) { | 440 const GrPathUtils::QuadUVMatrix& devToUV) { |
442 return SkNEW_ARGS(BezierQuadTestBatch, (gp, geo, devToUV)); | 441 return SkNEW_ARGS(BezierQuadTestBatch, (gp, geo, devToUV)); |
443 } | 442 } |
444 | 443 |
445 private: | 444 private: |
446 BezierQuadTestBatch(const GrGeometryProcessor* gp, const Geometry& geo, | 445 BezierQuadTestBatch(const GrGeometryProcessor* gp, const Geometry& geo, |
447 const GrPathUtils::QuadUVMatrix& devToUV) | 446 const GrPathUtils::QuadUVMatrix& devToUV) |
448 : INHERITED(gp, geo.fBounds) | 447 : INHERITED(gp, geo.fBounds) |
449 , fGeometry(geo) | 448 , fGeometry(geo) |
450 , fDevToUV(devToUV) { | 449 , fDevToUV(devToUV) { |
451 this->initClassID<BezierQuadTestBatch>(); | |
452 } | 450 } |
453 | 451 |
454 struct Vertex { | 452 struct Vertex { |
455 SkPoint fPosition; | 453 SkPoint fPosition; |
456 float fKLM[4]; // The last value is ignored. The effect expects a vec4
f. | 454 float fKLM[4]; // The last value is ignored. The effect expects a vec4
f. |
457 }; | 455 }; |
458 | 456 |
459 Geometry* geoData(int index) override { | 457 Geometry* geoData(int index) override { |
460 SkASSERT(0 == index); | 458 SkASSERT(0 == index); |
461 return &fGeometry; | 459 return &fGeometry; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 typedef GM INHERITED; | 627 typedef GM INHERITED; |
630 }; | 628 }; |
631 | 629 |
632 DEF_GM( return SkNEW(BezierCubicEffects); ) | 630 DEF_GM( return SkNEW(BezierCubicEffects); ) |
633 DEF_GM( return SkNEW(BezierConicEffects); ) | 631 DEF_GM( return SkNEW(BezierConicEffects); ) |
634 DEF_GM( return SkNEW(BezierQuadEffects); ) | 632 DEF_GM( return SkNEW(BezierQuadEffects); ) |
635 | 633 |
636 } | 634 } |
637 | 635 |
638 #endif | 636 #endif |
OLD | NEW |