Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: src/gpu/GrDrawState.h

Issue 362023002: Reduce integer divides in GrAllocator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: iter getters Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrAllocator.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrAllocator.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698