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 1237283007: Give GrBatch a pointer to GrPipeline (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 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') | 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 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
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>();
49 for (int i = 0; i < 9; i++) { 50 for (int i = 0; i < 9; i++) {
50 fKlmEqs[i] = klmEqs[i]; 51 fKlmEqs[i] = klmEqs[i];
51 } 52 }
52 53
53 fGeometry = geo; 54 fGeometry = geo;
54 fSign = sign; 55 fSign = sign;
55 } 56 }
56 57
57 struct Vertex { 58 struct Vertex {
58 SkPoint fPosition; 59 SkPoint fPosition;
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 const GrPathUtils::QuadUVMatrix& devToUV) { 441 const GrPathUtils::QuadUVMatrix& devToUV) {
441 return SkNEW_ARGS(BezierQuadTestBatch, (gp, geo, devToUV)); 442 return SkNEW_ARGS(BezierQuadTestBatch, (gp, geo, devToUV));
442 } 443 }
443 444
444 private: 445 private:
445 BezierQuadTestBatch(const GrGeometryProcessor* gp, const Geometry& geo, 446 BezierQuadTestBatch(const GrGeometryProcessor* gp, const Geometry& geo,
446 const GrPathUtils::QuadUVMatrix& devToUV) 447 const GrPathUtils::QuadUVMatrix& devToUV)
447 : INHERITED(gp, geo.fBounds) 448 : INHERITED(gp, geo.fBounds)
448 , fGeometry(geo) 449 , fGeometry(geo)
449 , fDevToUV(devToUV) { 450 , fDevToUV(devToUV) {
451 this->initClassID<BezierQuadTestBatch>();
450 } 452 }
451 453
452 struct Vertex { 454 struct Vertex {
453 SkPoint fPosition; 455 SkPoint fPosition;
454 float fKLM[4]; // The last value is ignored. The effect expects a vec4 f. 456 float fKLM[4]; // The last value is ignored. The effect expects a vec4 f.
455 }; 457 };
456 458
457 Geometry* geoData(int index) override { 459 Geometry* geoData(int index) override {
458 SkASSERT(0 == index); 460 SkASSERT(0 == index);
459 return &fGeometry; 461 return &fGeometry;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 typedef GM INHERITED; 629 typedef GM INHERITED;
628 }; 630 };
629 631
630 DEF_GM( return SkNEW(BezierCubicEffects); ) 632 DEF_GM( return SkNEW(BezierCubicEffects); )
631 DEF_GM( return SkNEW(BezierConicEffects); ) 633 DEF_GM( return SkNEW(BezierConicEffects); )
632 DEF_GM( return SkNEW(BezierQuadEffects); ) 634 DEF_GM( return SkNEW(BezierQuadEffects); )
633 635
634 } 636 }
635 637
636 #endif 638 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698