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

Side by Side Diff: gm/beziereffects.cpp

Issue 1483103003: Make onPrepareDraws const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: merge Created 5 years 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 generateGeometry(Target* target) override { 73 void generateGeometry(Target* target) const 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(target, vertexStri de, 1)); 77 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri de, 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 Geometry* geoData(int index) override { 463 Geometry* geoData(int index) override {
464 SkASSERT(0 == index); 464 SkASSERT(0 == index);
465 return &fGeometry; 465 return &fGeometry;
466 } 466 }
467 467
468 const Geometry* geoData(int index) const override { 468 const Geometry* geoData(int index) const override {
469 SkASSERT(0 == index); 469 SkASSERT(0 == index);
470 return &fGeometry; 470 return &fGeometry;
471 } 471 }
472 472
473 void generateGeometry(Target* target) override { 473 void generateGeometry(Target* target) const override {
474 QuadHelper helper; 474 QuadHelper helper;
475 size_t vertexStride = this->geometryProcessor()->getVertexStride(); 475 size_t vertexStride = this->geometryProcessor()->getVertexStride();
476 SkASSERT(vertexStride == sizeof(Vertex)); 476 SkASSERT(vertexStride == sizeof(Vertex));
477 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri de, 1)); 477 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri de, 1));
478 if (!verts) { 478 if (!verts) {
479 return; 479 return;
480 } 480 }
481 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop, 481 verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds .fTop,
482 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom, 482 fGeometry.fBounds.fRight, fGeometry.fBound s.fBottom,
483 sizeof(Vertex)); 483 sizeof(Vertex));
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 private: 635 private:
636 typedef GM INHERITED; 636 typedef GM INHERITED;
637 }; 637 };
638 638
639 DEF_GM(return new BezierCubicEffects;) 639 DEF_GM(return new BezierCubicEffects;)
640 DEF_GM(return new BezierConicEffects;) 640 DEF_GM(return new BezierConicEffects;)
641 DEF_GM(return new BezierQuadEffects;) 641 DEF_GM(return new BezierQuadEffects;)
642 } 642 }
643 643
644 #endif 644 #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