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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1007 | 1007 |
1008 void restoreTo(GrDrawState* drawState) { | 1008 void restoreTo(GrDrawState* drawState) { |
1009 SkASSERT(fInitialized); | 1009 SkASSERT(fInitialized); |
1010 drawState->fCommon = fCommon; | 1010 drawState->fCommon = fCommon; |
1011 drawState->setRenderTarget(fRenderTarget); | 1011 drawState->setRenderTarget(fRenderTarget); |
1012 // reinflate color/cov stage arrays. | 1012 // reinflate color/cov stage arrays. |
1013 drawState->fColorStages.reset(); | 1013 drawState->fColorStages.reset(); |
1014 for (int i = 0; i < fColorStageCnt; ++i) { | 1014 for (int i = 0; i < fColorStageCnt; ++i) { |
1015 SkNEW_APPEND_TO_TARRAY(&drawState->fColorStages, GrEffectStage, (fStages[i])); | 1015 SkNEW_APPEND_TO_TARRAY(&drawState->fColorStages, GrEffectStage, (fStages[i])); |
1016 } | 1016 } |
1017 int coverageStageCnt = fStages.count() - fColorStageCnt; | 1017 int coverageStageCnt = int(fStages.count()) - fColorStageCnt; |
bsalomon
2013/10/14 15:17:02
I think we conventionally write this cast as (int)
robertphillips
2013/10/14 17:39:26
Done.
| |
1018 drawState->fCoverageStages.reset(); | 1018 drawState->fCoverageStages.reset(); |
1019 for (int i = 0; i < coverageStageCnt; ++i) { | 1019 for (int i = 0; i < coverageStageCnt; ++i) { |
1020 SkNEW_APPEND_TO_TARRAY(&drawState->fCoverageStages, | 1020 SkNEW_APPEND_TO_TARRAY(&drawState->fCoverageStages, |
1021 GrEffectStage, (fStages[i + fColorStageC nt])); | 1021 GrEffectStage, (fStages[i + fColorStageC nt])); |
1022 } | 1022 } |
1023 } | 1023 } |
1024 | 1024 |
1025 bool isEqual(const GrDrawState& state) const { | 1025 bool isEqual(const GrDrawState& state) const { |
1026 int numCoverageStages = fStages.count() - fColorStageCnt; | 1026 int numCoverageStages = int(fStages.count()) - fColorStageCnt; |
1027 if (fRenderTarget != state.fRenderTarget.get() || | 1027 if (fRenderTarget != state.fRenderTarget.get() || |
1028 fColorStageCnt != state.fColorStages.count() || | 1028 fColorStageCnt != state.fColorStages.count() || |
1029 numCoverageStages != state.fCoverageStages.count() || | 1029 numCoverageStages != state.fCoverageStages.count() || |
1030 fCommon != state.fCommon) { | 1030 fCommon != state.fCommon) { |
1031 return false; | 1031 return false; |
1032 } | 1032 } |
1033 bool explicitLocalCoords = state.hasLocalCoordAttribute(); | 1033 bool explicitLocalCoords = state.hasLocalCoordAttribute(); |
1034 for (int i = 0; i < fColorStageCnt; ++i) { | 1034 for (int i = 0; i < fColorStageCnt; ++i) { |
1035 if (!fStages[i].isEqual(state.fColorStages[i], explicitLocalCoor ds)) { | 1035 if (!fStages[i].isEqual(state.fColorStages[i], explicitLocalCoor ds)) { |
1036 return false; | 1036 return false; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1076 * @param count the number of attributes being set, limited to kMaxVer texAttribCnt. | 1076 * @param count the number of attributes being set, limited to kMaxVer texAttribCnt. |
1077 */ | 1077 */ |
1078 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1078 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
1079 | 1079 |
1080 typedef SkRefCnt INHERITED; | 1080 typedef SkRefCnt INHERITED; |
1081 }; | 1081 }; |
1082 | 1082 |
1083 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1083 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1084 | 1084 |
1085 #endif | 1085 #endif |
OLD | NEW |