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

Unified Diff: gm/beziereffects.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
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | gm/convexpolyeffect.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/beziereffects.cpp
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 9ab4cd3aa72ff4f5489c0e318a7f689f1a21ced7..5070eeaf29c639eac923b3d1388dcbf192739e98 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -64,6 +64,11 @@ private:
return &fGeometry;
}
+ const Geometry* geoData(int index) const override {
+ SkASSERT(0 == index);
+ return &fGeometry;
+ }
+
void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override {
QuadHelper helper;
size_t vertexStride = this->geometryProcessor()->getVertexStride();
@@ -138,6 +143,7 @@ protected:
SkScalar h = SkIntToScalar(rt->height()) / numRows;
int row = 0;
int col = 0;
robertphillips 2015/05/13 20:33:50 Use SK_ColorBLACK ?
+ static const GrColor color = 0xff000000;
for (int i = 0; i < kNumCubics; ++i) {
SkPoint baseControlPts[] = {
@@ -155,7 +161,7 @@ protected:
continue;
}
GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType;
- gp.reset(GrCubicEffect::Create(0xff000000, SkMatrix::I(), et,
+ gp.reset(GrCubicEffect::Create(color, SkMatrix::I(), et,
*tt.target()->caps()));
if (!gp) {
continue;
@@ -217,7 +223,7 @@ protected:
pipelineBuilder.setRenderTarget(rt);
BezierCubicOrConicTestBatch::Geometry geometry;
- geometry.fColor = gp->color();
+ geometry.fColor = color;
geometry.fBounds = bounds;
SkAutoTUnref<GrBatch> batch(
@@ -285,6 +291,7 @@ protected:
SkScalar h = SkIntToScalar(rt->height()) / numRows;
int row = 0;
int col = 0;
robertphillips 2015/05/13 20:33:50 ditto ?
+ static const GrColor color = 0xff000000;
for (int i = 0; i < kNumConics; ++i) {
SkPoint baseControlPts[] = {
@@ -302,7 +309,7 @@ protected:
continue;
}
GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType;
- gp.reset(GrConicEffect::Create(0xff000000, SkMatrix::I(), et,
+ gp.reset(GrConicEffect::Create(color, SkMatrix::I(), et,
*tt.target()->caps(), SkMatrix::I()));
if (!gp) {
continue;
@@ -361,7 +368,7 @@ protected:
pipelineBuilder.setRenderTarget(rt);
BezierCubicOrConicTestBatch::Geometry geometry;
- geometry.fColor = gp->color();
+ geometry.fColor = color;
geometry.fBounds = bounds;
SkAutoTUnref<GrBatch> batch(
@@ -452,6 +459,11 @@ private:
return &fGeometry;
}
+ const Geometry* geoData(int index) const override {
+ SkASSERT(0 == index);
+ return &fGeometry;
+ }
+
void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override {
QuadHelper helper;
size_t vertexStride = this->geometryProcessor()->getVertexStride();
@@ -520,6 +532,7 @@ protected:
SkScalar h = SkIntToScalar(rt->height()) / numRows;
int row = 0;
int col = 0;
robertphillips 2015/05/13 20:33:50 here too ?
+ static const GrColor color = 0xff000000;
for (int i = 0; i < kNumQuads; ++i) {
SkPoint baseControlPts[] = {
@@ -536,7 +549,7 @@ protected:
continue;
}
GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType;
- gp.reset(GrQuadEffect::Create(0xff000000, SkMatrix::I(), et,
+ gp.reset(GrQuadEffect::Create(color, SkMatrix::I(), et,
*tt.target()->caps(), SkMatrix::I()));
if (!gp) {
continue;
@@ -594,7 +607,7 @@ protected:
GrPathUtils::QuadUVMatrix DevToUV(pts);
BezierQuadTestBatch::Geometry geometry;
- geometry.fColor = gp->color();
+ geometry.fColor = color;
geometry.fBounds = bounds;
SkAutoTUnref<GrBatch> batch(BezierQuadTestBatch::Create(gp, geometry, DevToUV));
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | gm/convexpolyeffect.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698