From ff6ea2663f76aa85ec55ddd0f00ca7906f1bc4e3 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Tue, 12 Mar 2013 12:26:08 +0000 Subject: 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 --- src/gpu/GrDrawState.h | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'src/gpu/GrDrawState.h') 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; -- cgit v1.2.3