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

Unified Diff: gm/convexpolyeffect.cpp

Issue 1140983002: remove color from GrGeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup2
Patch Set: more 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 side-by-side diff with in-line comments
Download patch
Index: gm/convexpolyeffect.cpp
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index b9c07d23d202e2963368a081eca243d388526dd8..9c6741aac6bae69b318f558e7954c2eeeabde7db 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -50,6 +50,11 @@ private:
return &fGeometry;
}
+ const Geometry* geoData(int index) const override {
+ SkASSERT(0 == index);
+ return &fGeometry;
+ }
+
void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override {
size_t vertexStride = this->geometryProcessor()->getVertexStride();
SkASSERT(vertexStride == sizeof(SkPoint));
@@ -151,9 +156,9 @@ protected:
return;
}
robertphillips 2015/05/13 20:33:50 Here too ?
+ static const GrColor color = 0xff000000;
SkAutoTUnref<const GrGeometryProcessor> gp(
- GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPosition_GPType,
- 0xff000000));
+ GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPosition_GPType, color));
SkScalar y = 0;
for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_IterStart);
@@ -184,7 +189,7 @@ protected:
pipelineBuilder.setRenderTarget(rt);
ConvexPolyTestBatch::Geometry geometry;
- geometry.fColor = gp->color();
+ geometry.fColor = color;
geometry.fBounds = p.getBounds();
SkAutoTUnref<GrBatch> batch(ConvexPolyTestBatch::Create(gp, geometry));
@@ -233,7 +238,7 @@ protected:
pipelineBuilder.setRenderTarget(rt);
ConvexPolyTestBatch::Geometry geometry;
- geometry.fColor = gp->color();
+ geometry.fColor = color;
geometry.fBounds = rect;
SkAutoTUnref<GrBatch> batch(ConvexPolyTestBatch::Create(gp, geometry));

Powered by Google App Engine
This is Rietveld 408576698