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

Side by Side Diff: gm/beziereffects.cpp

Issue 1275083002: Don't pass pipeline to GrBatch::generateGeometry() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 Geometry* geoData(int index) override { 63 Geometry* geoData(int index) override {
64 SkASSERT(0 == index); 64 SkASSERT(0 == index);
65 return &fGeometry; 65 return &fGeometry;
66 } 66 }
67 67
68 const Geometry* geoData(int index) const override { 68 const Geometry* geoData(int index) const override {
69 SkASSERT(0 == index); 69 SkASSERT(0 == index);
70 return &fGeometry; 70 return &fGeometry;
71 } 71 }
72 72
73 void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeli ne) override { 73 void onGenerateGeometry(GrBatchTarget* batchTarget) override {
74 QuadHelper helper; 74 QuadHelper helper;
75 size_t vertexStride = this->geometryProcessor()->getVertexStride(); 75 size_t vertexStride = this->geometryProcessor()->getVertexStride();
76 SkASSERT(vertexStride == sizeof(Vertex)); 76 SkASSERT(vertexStride == sizeof(Vertex));
77 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(batchTarget, verte xStride, 1)); 77 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(batchTarget, verte xStride, 1));
78 if (!verts) { 78 if (!verts) {
79 return; 79 return;
80 } 80 }
81 81
82 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop, 82 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop,
83 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom, 83 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom,
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 Geometry* geoData(int index) override { 459 Geometry* geoData(int index) override {
460 SkASSERT(0 == index); 460 SkASSERT(0 == index);
461 return &fGeometry; 461 return &fGeometry;
462 } 462 }
463 463
464 const Geometry* geoData(int index) const override { 464 const Geometry* geoData(int index) const override {
465 SkASSERT(0 == index); 465 SkASSERT(0 == index);
466 return &fGeometry; 466 return &fGeometry;
467 } 467 }
468 468
469 void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeli ne) override { 469 void onGenerateGeometry(GrBatchTarget* batchTarget) override {
470 QuadHelper helper; 470 QuadHelper helper;
471 size_t vertexStride = this->geometryProcessor()->getVertexStride(); 471 size_t vertexStride = this->geometryProcessor()->getVertexStride();
472 SkASSERT(vertexStride == sizeof(Vertex)); 472 SkASSERT(vertexStride == sizeof(Vertex));
473 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(batchTarget, verte xStride, 1)); 473 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(batchTarget, verte xStride, 1));
474 if (!verts) { 474 if (!verts) {
475 return; 475 return;
476 } 476 }
477 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop, 477 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop,
478 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom, 478 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom,
479 sizeof(Vertex)); 479 sizeof(Vertex));
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 typedef GM INHERITED; 629 typedef GM INHERITED;
630 }; 630 };
631 631
632 DEF_GM( return SkNEW(BezierCubicEffects); ) 632 DEF_GM( return SkNEW(BezierCubicEffects); )
633 DEF_GM( return SkNEW(BezierConicEffects); ) 633 DEF_GM( return SkNEW(BezierConicEffects); )
634 DEF_GM( return SkNEW(BezierQuadEffects); ) 634 DEF_GM( return SkNEW(BezierQuadEffects); )
635 635
636 } 636 }
637 637
638 #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