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 14 matching lines...) Expand all Loading... |
25 #include "effects/GrBezierEffect.h" | 25 #include "effects/GrBezierEffect.h" |
26 | 26 |
27 static inline SkScalar eval_line(const SkPoint& p, const SkScalar lineEq[3], SkS
calar sign) { | 27 static inline SkScalar eval_line(const SkPoint& p, const SkScalar lineEq[3], SkS
calar sign) { |
28 return sign * (lineEq[0] * p.fX + lineEq[1] * p.fY + lineEq[2]); | 28 return sign * (lineEq[0] * p.fX + lineEq[1] * p.fY + lineEq[2]); |
29 } | 29 } |
30 | 30 |
31 namespace skiagm { | 31 namespace skiagm { |
32 | 32 |
33 class BezierCubicOrConicTestBatch : public GrTestBatch { | 33 class BezierCubicOrConicTestBatch : public GrTestBatch { |
34 public: | 34 public: |
| 35 BATCH_CLASS_ID |
35 struct Geometry : public GrTestBatch::Geometry { | 36 struct Geometry : public GrTestBatch::Geometry { |
36 SkRect fBounds; | 37 SkRect fBounds; |
37 }; | 38 }; |
38 | 39 |
39 const char* name() const override { return "BezierCubicOrConicTestBatch"; } | 40 const char* name() const override { return "BezierCubicOrConicTestBatch"; } |
40 | 41 |
41 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge
o, | 42 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge
o, |
42 const SkScalar klmEqs[9], SkScalar sign) { | 43 const SkScalar klmEqs[9], SkScalar sign) { |
43 return new BezierCubicOrConicTestBatch(gp, geo, klmEqs, sign); | 44 return new BezierCubicOrConicTestBatch(gp, geo, klmEqs, sign); |
44 } | 45 } |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 return conicCnt; | 426 return conicCnt; |
426 } | 427 } |
427 | 428 |
428 typedef GM INHERITED; | 429 typedef GM INHERITED; |
429 }; | 430 }; |
430 | 431 |
431 ////////////////////////////////////////////////////////////////////////////// | 432 ////////////////////////////////////////////////////////////////////////////// |
432 | 433 |
433 class BezierQuadTestBatch : public GrTestBatch { | 434 class BezierQuadTestBatch : public GrTestBatch { |
434 public: | 435 public: |
| 436 BATCH_CLASS_ID |
435 struct Geometry : public GrTestBatch::Geometry { | 437 struct Geometry : public GrTestBatch::Geometry { |
436 SkRect fBounds; | 438 SkRect fBounds; |
437 }; | 439 }; |
438 | 440 |
439 const char* name() const override { return "BezierQuadTestBatch"; } | 441 const char* name() const override { return "BezierQuadTestBatch"; } |
440 | 442 |
441 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge
o, | 443 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge
o, |
442 const GrPathUtils::QuadUVMatrix& devToUV) { | 444 const GrPathUtils::QuadUVMatrix& devToUV) { |
443 return new BezierQuadTestBatch(gp, geo, devToUV); | 445 return new BezierQuadTestBatch(gp, geo, devToUV); |
444 } | 446 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 private: | 632 private: |
631 typedef GM INHERITED; | 633 typedef GM INHERITED; |
632 }; | 634 }; |
633 | 635 |
634 DEF_GM(return new BezierCubicEffects;) | 636 DEF_GM(return new BezierCubicEffects;) |
635 DEF_GM(return new BezierConicEffects;) | 637 DEF_GM(return new BezierConicEffects;) |
636 DEF_GM(return new BezierQuadEffects;) | 638 DEF_GM(return new BezierQuadEffects;) |
637 } | 639 } |
638 | 640 |
639 #endif | 641 #endif |
OLD | NEW |