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

Side by Side Diff: gm/beziereffects.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 | « no previous file | gm/convexpolyeffect.cpp » ('j') | src/gpu/GrAtlasTextContext.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | src/gpu/GrAtlasTextContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698