OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 fDstBlend != that.fDstBlend || | 886 fDstBlend != that.fDstBlend || |
887 fBlendConstant != that.fBlendConstant || | 887 fBlendConstant != that.fBlendConstant || |
888 fFlagBits != that.fFlagBits || | 888 fFlagBits != that.fFlagBits || |
889 fVACount != that.fVACount || | 889 fVACount != that.fVACount || |
890 memcmp(fVAPtr, that.fVAPtr, fVACount * sizeof(GrVertexAttrib)) || | 890 memcmp(fVAPtr, that.fVAPtr, fVACount * sizeof(GrVertexAttrib)) || |
891 fStencilSettings != that.fStencilSettings || | 891 fStencilSettings != that.fStencilSettings || |
892 fCoverage != that.fCoverage || | 892 fCoverage != that.fCoverage || |
893 fDrawFace != that.fDrawFace) { | 893 fDrawFace != that.fDrawFace) { |
894 return false; | 894 return false; |
895 } | 895 } |
| 896 |
| 897 bool explicitLocalCoords = this->hasLocalCoordAttribute(); |
896 for (int i = 0; i < fColorStages.count(); i++) { | 898 for (int i = 0; i < fColorStages.count(); i++) { |
897 if (fColorStages[i] != that.fColorStages[i]) { | 899 if (!GrEffectStage::AreCompatible(fColorStages[i], that.fColorStages
[i], |
| 900 explicitLocalCoords)) { |
898 return false; | 901 return false; |
899 } | 902 } |
900 } | 903 } |
901 for (int i = 0; i < fCoverageStages.count(); i++) { | 904 for (int i = 0; i < fCoverageStages.count(); i++) { |
902 if (fCoverageStages[i] != that.fCoverageStages[i]) { | 905 if (!GrEffectStage::AreCompatible(fCoverageStages[i], that.fCoverage
Stages[i], |
| 906 explicitLocalCoords)) { |
903 return false; | 907 return false; |
904 } | 908 } |
905 } | 909 } |
906 SkASSERT(0 == memcmp(fFixedFunctionVertexAttribIndices, | 910 SkASSERT(0 == memcmp(fFixedFunctionVertexAttribIndices, |
907 that.fFixedFunctionVertexAttribIndices, | 911 that.fFixedFunctionVertexAttribIndices, |
908 sizeof(fFixedFunctionVertexAttribIndices))); | 912 sizeof(fFixedFunctionVertexAttribIndices))); |
909 return true; | 913 return true; |
910 } | 914 } |
911 bool operator !=(const GrDrawState& s) const { return !(*this == s); } | 915 bool operator !=(const GrDrawState& s) const { return !(*this == s); } |
912 | 916 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1009 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
1006 */ | 1010 */ |
1007 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1011 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
1008 | 1012 |
1009 typedef SkRefCnt INHERITED; | 1013 typedef SkRefCnt INHERITED; |
1010 }; | 1014 }; |
1011 | 1015 |
1012 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1016 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1013 | 1017 |
1014 #endif | 1018 #endif |
OLD | NEW |