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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1352813003: add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 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 | « gm/beziereffects.cpp ('k') | src/gpu/GrAtlasTextContext.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 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
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
34 struct Geometry : public GrTestBatch::Geometry { 35 struct Geometry : public GrTestBatch::Geometry {
35 SkRect fBounds; 36 SkRect fBounds;
36 }; 37 };
37 38
38 const char* name() const override { return "ConvexPolyTestBatch"; } 39 const char* name() const override { return "ConvexPolyTestBatch"; }
39 40
40 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge o) { 41 static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& ge o) {
41 return new ConvexPolyTestBatch(gp, geo); 42 return new ConvexPolyTestBatch(gp, geo);
42 } 43 }
43 44
44 private: 45 private:
45 ConvexPolyTestBatch(const GrGeometryProcessor* gp, const Geometry& geo) 46 ConvexPolyTestBatch(const GrGeometryProcessor* gp, const Geometry& geo)
46 : INHERITED(gp, geo.fBounds) 47 : INHERITED(ClassID(), gp, geo.fBounds)
47 , fGeometry(geo) { 48 , 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
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
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698