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

Unified Diff: src/gpu/effects/GrDashingEffect.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: src/gpu/effects/GrDashingEffect.cpp
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index d3df886bd46c5f625be61dbb1f20b109eafbfc9c..588a8f0435aa575edf118afcfd3108b12c0cba4f 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -783,6 +783,8 @@ public:
DashAAMode aaMode() const { return fAAMode; }
+ GrColor color() const { return fColor; }
+
virtual void getGLProcessorKey(const GrBatchTracker&,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) const override;
@@ -795,6 +797,7 @@ public:
private:
DashingCircleEffect(GrColor, DashAAMode aaMode, const SkMatrix& localMatrix);
+ GrColor fColor;
DashAAMode fAAMode;
const Attribute* fInPosition;
const Attribute* fInDashParams;
@@ -937,7 +940,9 @@ GrGLPrimitiveProcessor* DashingCircleEffect::createGLInstance(const GrBatchTrack
DashingCircleEffect::DashingCircleEffect(GrColor color,
DashAAMode aaMode,
const SkMatrix& localMatrix)
- : INHERITED(color, SkMatrix::I(), localMatrix), fAAMode(aaMode) {
+ : INHERITED(SkMatrix::I(), localMatrix)
+ , fColor(color)
+ , fAAMode(aaMode) {
this->initClassID<DashingCircleEffect>();
fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVertexAttribType));
@@ -999,6 +1004,8 @@ public:
DashAAMode aaMode() const { return fAAMode; }
+ GrColor color() const { return fColor; }
+
virtual void getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
@@ -1011,6 +1018,7 @@ public:
private:
DashingLineEffect(GrColor, DashAAMode aaMode, const SkMatrix& localMatrix);
+ GrColor fColor;
DashAAMode fAAMode;
const Attribute* fInPosition;
const Attribute* fInDashParams;
@@ -1165,7 +1173,9 @@ GrGLPrimitiveProcessor* DashingLineEffect::createGLInstance(const GrBatchTracker
DashingLineEffect::DashingLineEffect(GrColor color,
DashAAMode aaMode,
const SkMatrix& localMatrix)
- : INHERITED(color, SkMatrix::I(), localMatrix), fAAMode(aaMode) {
+ : INHERITED(SkMatrix::I(), localMatrix)
+ , fColor(color)
+ , fAAMode(aaMode) {
this->initClassID<DashingLineEffect>();
fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
fInDashParams = &this->addVertexAttrib(Attribute("inDashParams", kVec3f_GrVertexAttribType));

Powered by Google App Engine
This is Rietveld 408576698