diff options
author | 2013-03-12 12:26:08 +0000 | |
---|---|---|
committer | 2013-03-12 12:26:08 +0000 | |
commit | ff6ea2663f76aa85ec55ddd0f00ca7906f1bc4e3 (patch) | |
tree | 54941da56d3d90540bb21bfab8ca11f0504951e9 /src/gpu/GrDrawState.h | |
parent | 2e71f1619d9a2c51c1292e618f42a56ad2da1de8 (diff) |
Add GrEllipseEdgeEffect.
Adds the effect that replaces the old oval rendering code. Also hooks in code to set attribute names and indices for effects.
Author: jvanverth@google.com
Review URL: https://chromiumcodereview.appspot.com/12462008
git-svn-id: http://skia.googlecode.com/svn/trunk@8092 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrDrawState.h')
-rw-r--r-- | src/gpu/GrDrawState.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index 3f372973ab..220e290a83 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -181,6 +181,8 @@ public: */ void setDefaultVertexAttribs(); + bool validateVertexAttribs() const; + //////////////////////////////////////////////////////////////////////////// // Helpers for picking apart vertex attributes @@ -332,7 +334,7 @@ public: bool hasSolidCoverage(GrAttribBindings) const; static void VertexAttributesUnitTest(); - + /// @} /////////////////////////////////////////////////////////////////////////// @@ -483,8 +485,9 @@ public: /// @name Effect Stages //// - const GrEffectRef* setEffect(int stageIdx, const GrEffectRef* effect) { - fStages[stageIdx].setEffect(effect); + const GrEffectRef* setEffect(int stageIdx, const GrEffectRef* effect, + const int* indices = NULL) { + fStages[stageIdx].setEffect(effect, indices); return effect; } @@ -514,7 +517,9 @@ public: return true; } - void disableStage(int stageIdx) { this->setEffect(stageIdx, NULL); } + void disableStage(int stageIdx) { + this->setEffect(stageIdx, NULL, NULL); + } /** * Release all the GrEffects referred to by this draw state. @@ -1021,9 +1026,6 @@ public: /* Circle specified as center_x, center_y, outer_radius, inner_radius all in window space (y-down). */ kCircle_EdgeType, - /* Axis-aligned ellipse specified as center_x, center_y, x_radius, x_radius/y_radius - all in window space (y-down). */ - kEllipse_EdgeType, kVertexEdgeTypeCnt }; @@ -1189,14 +1191,9 @@ public: if (fRenderTarget.get() != s.fRenderTarget.get() || fCommon != s.fCommon) { return false; } - if (fVertexAttribs.count() != s.fVertexAttribs.count()) { + if (fVertexAttribs != s.fVertexAttribs) { return false; } - for (int i = 0; i < fVertexAttribs.count(); ++i) { - if (fVertexAttribs[i] != s.fVertexAttribs[i]) { - return false; - } - } for (int i = 0; i < kAttribIndexCount; ++i) { if ((i == kPosition_AttribIndex || s.fCommon.fAttribBindings & kAttribIndexMasks[i]) && @@ -1335,13 +1332,9 @@ public: return false; } } - if (fVertexAttribs.count() != state.fVertexAttribs.count()) { + if (fVertexAttribs != state.fVertexAttribs) { return false; } - for (int i = 0; i < fVertexAttribs.count(); ++i) - if (fVertexAttribs[i] != state.fVertexAttribs[i]) { - return false; - } for (int i = 0; i < kNumStages; ++i) { if (!fStages[i].isEqual(state.fStages[i])) { return false; |