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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
714 * Shortcut to disable stencil testing and ops. | 714 * Shortcut to disable stencil testing and ops. |
715 */ | 715 */ |
716 void disableStencil() { | 716 void disableStencil() { |
717 fCommon.fStencilSettings.setDisabled(); | 717 fCommon.fStencilSettings.setDisabled(); |
718 } | 718 } |
719 | 719 |
720 const GrStencilSettings& getStencil() const { return fCommon.fStencilSetting s; } | 720 const GrStencilSettings& getStencil() const { return fCommon.fStencilSetting s; } |
721 | 721 |
722 GrStencilSettings* stencil() { return &fCommon.fStencilSettings; } | 722 GrStencilSettings* stencil() { return &fCommon.fStencilSettings; } |
723 | 723 |
724 void setStencilPathSettings(const GrStencilSettings& settings) { | |
725 fCommon.fPathStencilSettings = settings; | |
726 } | |
727 | |
728 const GrStencilSettings& getStencilPathSettings() const { return fCommon.fPa thStencilSettings; } | |
729 | |
724 /// @} | 730 /// @} |
725 | 731 |
726 /////////////////////////////////////////////////////////////////////////// | 732 /////////////////////////////////////////////////////////////////////////// |
727 /// @name State Flags | 733 /// @name State Flags |
728 //// | 734 //// |
729 | 735 |
730 /** | 736 /** |
731 * Flags that affect rendering. Controlled using enable/disableState(). All | 737 * Flags that affect rendering. Controlled using enable/disableState(). All |
732 * default to disabled. | 738 * default to disabled. |
733 */ | 739 */ |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
924 // These fields are roughly sorted by decreasing likelihood of being dif ferent in op== | 930 // These fields are roughly sorted by decreasing likelihood of being dif ferent in op== |
925 GrColor fColor; | 931 GrColor fColor; |
926 SkMatrix fViewMatrix; | 932 SkMatrix fViewMatrix; |
927 GrBlendCoeff fSrcBlend; | 933 GrBlendCoeff fSrcBlend; |
928 GrBlendCoeff fDstBlend; | 934 GrBlendCoeff fDstBlend; |
929 GrColor fBlendConstant; | 935 GrColor fBlendConstant; |
930 uint32_t fFlagBits; | 936 uint32_t fFlagBits; |
931 const GrVertexAttrib* fVAPtr; | 937 const GrVertexAttrib* fVAPtr; |
932 int fVACount; | 938 int fVACount; |
933 GrStencilSettings fStencilSettings; | 939 GrStencilSettings fStencilSettings; |
940 GrStencilSettings fPathStencilSettings; | |
bsalomon
2013/09/13 20:25:28
Is this necessary? I'm wondering if we could have
Kimmo Kinnunen
2013/09/18 07:52:38
Done.
| |
934 GrColor fCoverage; | 941 GrColor fCoverage; |
935 SkXfermode::Mode fColorFilterMode; | 942 SkXfermode::Mode fColorFilterMode; |
936 GrColor fColorFilterColor; | 943 GrColor fColorFilterColor; |
937 DrawFace fDrawFace; | 944 DrawFace fDrawFace; |
938 | 945 |
939 // This is simply a different representation of info in fVertexAttribs a nd thus does | 946 // This is simply a different representation of info in fVertexAttribs a nd thus does |
940 // not need to be compared in op==. | 947 // not need to be compared in op==. |
941 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindin gCnt]; | 948 int fFixedFunctionVertexAttribIndices[kGrFixedFunctionVertexAttribBindin gCnt]; |
942 | 949 |
943 bool operator== (const CommonState& other) const { | 950 bool operator== (const CommonState& other) const { |
944 bool result = fColor == other.fColor && | 951 bool result = fColor == other.fColor && |
945 fViewMatrix.cheapEqualTo(other.fViewMatrix) && | 952 fViewMatrix.cheapEqualTo(other.fViewMatrix) && |
946 fSrcBlend == other.fSrcBlend && | 953 fSrcBlend == other.fSrcBlend && |
947 fDstBlend == other.fDstBlend && | 954 fDstBlend == other.fDstBlend && |
948 fBlendConstant == other.fBlendConstant && | 955 fBlendConstant == other.fBlendConstant && |
949 fFlagBits == other.fFlagBits && | 956 fFlagBits == other.fFlagBits && |
950 fVACount == other.fVACount && | 957 fVACount == other.fVACount && |
951 !memcmp(fVAPtr, other.fVAPtr, fVACount * sizeof(GrVert exAttrib)) && | 958 !memcmp(fVAPtr, other.fVAPtr, fVACount * sizeof(GrVert exAttrib)) && |
952 fStencilSettings == other.fStencilSettings && | 959 fStencilSettings == other.fStencilSettings && |
960 fPathStencilSettings == other.fPathStencilSettings && | |
953 fCoverage == other.fCoverage && | 961 fCoverage == other.fCoverage && |
954 fColorFilterMode == other.fColorFilterMode && | 962 fColorFilterMode == other.fColorFilterMode && |
955 fColorFilterColor == other.fColorFilterColor && | 963 fColorFilterColor == other.fColorFilterColor && |
956 fDrawFace == other.fDrawFace; | 964 fDrawFace == other.fDrawFace; |
957 SkASSERT(!result || 0 == memcmp(fFixedFunctionVertexAttribIndices, | 965 SkASSERT(!result || 0 == memcmp(fFixedFunctionVertexAttribIndices, |
958 other.fFixedFunctionVertexAttribIndi ces, | 966 other.fFixedFunctionVertexAttribIndi ces, |
959 sizeof(fFixedFunctionVertexAttribInd ices))); | 967 sizeof(fFixedFunctionVertexAttribInd ices))); |
960 return result; | 968 return result; |
961 } | 969 } |
962 bool operator!= (const CommonState& other) const { return !(*this == oth er); } | 970 bool operator!= (const CommonState& other) const { return !(*this == oth er); } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1075 * @param count the number of attributes being set, limited to kMaxVer texAttribCnt. | 1083 * @param count the number of attributes being set, limited to kMaxVer texAttribCnt. |
1076 */ | 1084 */ |
1077 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1085 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
1078 | 1086 |
1079 typedef SkRefCnt INHERITED; | 1087 typedef SkRefCnt INHERITED; |
1080 }; | 1088 }; |
1081 | 1089 |
1082 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1090 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1083 | 1091 |
1084 #endif | 1092 #endif |
OLD | NEW |