OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "batches/GrTestBatch.h" | 25 #include "batches/GrTestBatch.h" |
26 #include "batches/GrVertexBatch.h" | 26 #include "batches/GrVertexBatch.h" |
27 | 27 |
28 #include "effects/GrConvexPolyEffect.h" | 28 #include "effects/GrConvexPolyEffect.h" |
29 | 29 |
30 namespace skiagm { | 30 namespace skiagm { |
31 | 31 |
32 class ConvexPolyTestBatch : public GrTestBatch { | 32 class ConvexPolyTestBatch : public GrTestBatch { |
33 public: | 33 public: |
34 DEFINE_BATCH_CLASS_ID | |
35 struct Geometry : public GrTestBatch::Geometry { | 34 struct Geometry : public GrTestBatch::Geometry { |
36 SkRect fBounds; | 35 SkRect fBounds; |
37 }; | 36 }; |
38 | 37 |
39 const char* name() const override { return "ConvexPolyTestBatch"; } | 38 const char* name() const override { return "ConvexPolyTestBatch"; } |
40 | 39 |
41 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge
o) { | 40 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge
o) { |
42 return new ConvexPolyTestBatch(gp, geo); | 41 return new ConvexPolyTestBatch(gp, geo); |
43 } | 42 } |
44 | 43 |
45 private: | 44 private: |
46 ConvexPolyTestBatch(const GrGeometryProcessor* gp, const Geometry& geo) | 45 ConvexPolyTestBatch(const GrGeometryProcessor* gp, const Geometry& geo) |
47 : INHERITED(ClassID(), gp, geo.fBounds) | 46 : INHERITED(gp, geo.fBounds) |
48 , fGeometry(geo) { | 47 , fGeometry(geo) { |
| 48 this->initClassID<ConvexPolyTestBatch>(); |
49 } | 49 } |
50 | 50 |
51 Geometry* geoData(int index) override { | 51 Geometry* geoData(int index) override { |
52 SkASSERT(0 == index); | 52 SkASSERT(0 == index); |
53 return &fGeometry; | 53 return &fGeometry; |
54 } | 54 } |
55 | 55 |
56 const Geometry* geoData(int index) const override { | 56 const Geometry* geoData(int index) const override { |
57 SkASSERT(0 == index); | 57 SkASSERT(0 == index); |
58 return &fGeometry; | 58 return &fGeometry; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 SkTLList<SkPath> fPaths; | 272 SkTLList<SkPath> fPaths; |
273 SkTLList<SkRect> fRects; | 273 SkTLList<SkRect> fRects; |
274 | 274 |
275 typedef GM INHERITED; | 275 typedef GM INHERITED; |
276 }; | 276 }; |
277 | 277 |
278 DEF_GM(return new ConvexPolyEffect;) | 278 DEF_GM(return new ConvexPolyEffect;) |
279 } | 279 } |
280 | 280 |
281 #endif | 281 #endif |
OLD | NEW |