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

Side by Side Diff: gm/beziereffects.cpp

Issue 1127273007: Iterate over instanced draws in GrGpu rather than above GrBatchTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove dead code Created 5 years, 7 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop, 76 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop,
77 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom, 77 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom,
78 sizeof(Vertex)); 78 sizeof(Vertex));
79 for (int v = 0; v < 4; ++v) { 79 for (int v = 0; v < 4; ++v) {
80 verts[v].fKLM[0] = eval_line(verts[v].fPosition, fKlmEqs + 0, fSign) ; 80 verts[v].fKLM[0] = eval_line(verts[v].fPosition, fKlmEqs + 0, fSign) ;
81 verts[v].fKLM[1] = eval_line(verts[v].fPosition, fKlmEqs + 3, fSign) ; 81 verts[v].fKLM[1] = eval_line(verts[v].fPosition, fKlmEqs + 3, fSign) ;
82 verts[v].fKLM[2] = eval_line(verts[v].fPosition, fKlmEqs + 6, 1.f); 82 verts[v].fKLM[2] = eval_line(verts[v].fPosition, fKlmEqs + 6, 1.f);
83 } 83 }
84 helper.issueDraws(batchTarget); 84 helper.issueDraw(batchTarget);
85 } 85 }
86 86
87 Geometry fGeometry; 87 Geometry fGeometry;
88 SkScalar fKlmEqs[9]; 88 SkScalar fKlmEqs[9];
89 SkScalar fSign; 89 SkScalar fSign;
90 90
91 static const int kVertsPerCubic = 4; 91 static const int kVertsPerCubic = 4;
92 static const int kIndicesPerCubic = 6; 92 static const int kIndicesPerCubic = 6;
93 93
94 typedef GrTestBatch INHERITED; 94 typedef GrTestBatch INHERITED;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 size_t vertexStride = this->geometryProcessor()->getVertexStride(); 457 size_t vertexStride = this->geometryProcessor()->getVertexStride();
458 SkASSERT(vertexStride == sizeof(Vertex)); 458 SkASSERT(vertexStride == sizeof(Vertex));
459 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(batchTarget, verte xStride, 1)); 459 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(batchTarget, verte xStride, 1));
460 if (!verts) { 460 if (!verts) {
461 return; 461 return;
462 } 462 }
463 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop, 463 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop,
464 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom, 464 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom,
465 sizeof(Vertex)); 465 sizeof(Vertex));
466 fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts); 466 fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts);
467 helper.issueDraws(batchTarget); 467 helper.issueDraw(batchTarget);
468 } 468 }
469 469
470 Geometry fGeometry; 470 Geometry fGeometry;
471 GrPathUtils::QuadUVMatrix fDevToUV; 471 GrPathUtils::QuadUVMatrix fDevToUV;
472 472
473 static const int kVertsPerCubic = 4; 473 static const int kVertsPerCubic = 4;
474 static const int kIndicesPerCubic = 6; 474 static const int kIndicesPerCubic = 6;
475 475
476 typedef GrTestBatch INHERITED; 476 typedef GrTestBatch INHERITED;
477 }; 477 };
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 typedef GM INHERITED; 614 typedef GM INHERITED;
615 }; 615 };
616 616
617 DEF_GM( return SkNEW(BezierCubicEffects); ) 617 DEF_GM( return SkNEW(BezierCubicEffects); )
618 DEF_GM( return SkNEW(BezierConicEffects); ) 618 DEF_GM( return SkNEW(BezierConicEffects); )
619 DEF_GM( return SkNEW(BezierQuadEffects); ) 619 DEF_GM( return SkNEW(BezierQuadEffects); )
620 620
621 } 621 }
622 622
623 #endif 623 #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