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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 fColorStageCnt = drawState.fColorStages.count(); | 976 fColorStageCnt = drawState.fColorStages.count(); |
977 for (int i = 0; i < fColorStageCnt; ++i) { | 977 for (int i = 0; i < fColorStageCnt; ++i) { |
978 fStages[i].saveFrom(drawState.fColorStages[i]); | 978 fStages[i].saveFrom(drawState.fColorStages[i]); |
979 } | 979 } |
980 for (int i = 0; i < drawState.fCoverageStages.count(); ++i) { | 980 for (int i = 0; i < drawState.fCoverageStages.count(); ++i) { |
981 fStages[i + fColorStageCnt].saveFrom(drawState.fCoverageStages[i
]); | 981 fStages[i + fColorStageCnt].saveFrom(drawState.fCoverageStages[i
]); |
982 } | 982 } |
983 SkDEBUGCODE(fInitialized = true;) | 983 SkDEBUGCODE(fInitialized = true;) |
984 } | 984 } |
985 | 985 |
986 void restoreTo(GrDrawState* drawState) { | 986 void restoreTo(GrDrawState* drawState) const { |
987 SkASSERT(fInitialized); | 987 SkASSERT(fInitialized); |
988 drawState->fCommon = fCommon; | 988 drawState->fCommon = fCommon; |
989 drawState->setRenderTarget(fRenderTarget); | 989 drawState->setRenderTarget(fRenderTarget); |
990 // reinflate color/cov stage arrays. | 990 // reinflate color/cov stage arrays. |
991 drawState->fColorStages.reset(); | 991 drawState->fColorStages.reset(); |
992 for (int i = 0; i < fColorStageCnt; ++i) { | 992 for (int i = 0; i < fColorStageCnt; ++i) { |
993 SkNEW_APPEND_TO_TARRAY(&drawState->fColorStages, GrEffectStage,
(fStages[i])); | 993 SkNEW_APPEND_TO_TARRAY(&drawState->fColorStages, GrEffectStage,
(fStages[i])); |
994 } | 994 } |
995 int coverageStageCnt = fStages.count() - fColorStageCnt; | 995 int coverageStageCnt = fStages.count() - fColorStageCnt; |
996 drawState->fCoverageStages.reset(); | 996 drawState->fCoverageStages.reset(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. | 1054 * @param count the number of attributes being set, limited to kMaxVer
texAttribCnt. |
1055 */ | 1055 */ |
1056 void setVertexAttribs(const GrVertexAttrib attribs[], int count); | 1056 void setVertexAttribs(const GrVertexAttrib attribs[], int count); |
1057 | 1057 |
1058 typedef SkRefCnt INHERITED; | 1058 typedef SkRefCnt INHERITED; |
1059 }; | 1059 }; |
1060 | 1060 |
1061 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1061 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1062 | 1062 |
1063 #endif | 1063 #endif |
OLD | NEW |