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

Side by Side Diff: src/gpu/GrOptDrawState.cpp

Issue 821243003: removing coord change matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@no-coordchange-on-drawstate
Patch Set: rebase Created 5 years, 11 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/GrDrawTarget.cpp ('k') | src/gpu/GrPaint.cpp » ('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 2014 Google Inc. 2 * Copyright 2014 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 #include "GrOptDrawState.h" 8 #include "GrOptDrawState.h"
9 9
10 #include "GrDrawState.h" 10 #include "GrDrawState.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 &firstColorStageIdx, &firstCoverageStag eIdx); 105 &firstColorStageIdx, &firstCoverageStag eIdx);
106 106
107 fDescInfo.fRequiresLocalCoordAttrib = hasLocalCoords; 107 fDescInfo.fRequiresLocalCoordAttrib = hasLocalCoords;
108 108
109 bool usesLocalCoords = false; 109 bool usesLocalCoords = false;
110 110
111 // Copy Stages from DS to ODS 111 // Copy Stages from DS to ODS
112 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) { 112 for (int i = firstColorStageIdx; i < drawState.numColorStages(); ++i) {
113 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, 113 SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
114 GrPendingFragmentStage, 114 GrPendingFragmentStage,
115 (drawState.fColorStages[i], hasLocalCoords)); 115 (drawState.fColorStages[i]));
116 usesLocalCoords = usesLocalCoords || 116 usesLocalCoords = usesLocalCoords ||
117 drawState.fColorStages[i].getProcessor()->usesLocalCoo rds(); 117 drawState.fColorStages[i].processor()->usesLocalCoords ();
118 } 118 }
119 119
120 fNumColorStages = fFragmentStages.count(); 120 fNumColorStages = fFragmentStages.count();
121 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i) { 121 for (int i = firstCoverageStageIdx; i < drawState.numCoverageStages(); ++i) {
122 SkNEW_APPEND_TO_TARRAY(&fFragmentStages, 122 SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
123 GrPendingFragmentStage, 123 GrPendingFragmentStage,
124 (drawState.fCoverageStages[i], hasLocalCoords)); 124 (drawState.fCoverageStages[i]));
125 usesLocalCoords = usesLocalCoords || 125 usesLocalCoords = usesLocalCoords ||
126 drawState.fCoverageStages[i].getProcessor()->usesLocal Coords(); 126 drawState.fCoverageStages[i].processor()->usesLocalCoo rds();
127 } 127 }
128 128
129 // let the GP init the batch tracker 129 // let the GP init the batch tracker
130 GrGeometryProcessor::InitBT init; 130 GrGeometryProcessor::InitBT init;
131 init.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFl ag); 131 init.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFl ag);
132 init.fOverrideColor = init.fColorIgnored ? GrColor_ILLEGAL : overrideColor; 132 init.fOverrideColor = init.fColorIgnored ? GrColor_ILLEGAL : overrideColor;
133 init.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage _OptFlag); 133 init.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage _OptFlag);
134 init.fUsesLocalCoords = usesLocalCoords; 134 init.fUsesLocalCoords = usesLocalCoords;
135 fPrimitiveProcessor->initBatchTracker(&fBatchTracker, init); 135 fPrimitiveProcessor->initBatchTracker(&fBatchTracker, init);
136 } 136 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { 206 if (this->getFragmentStage(i) != that.getFragmentStage(i)) {
207 return false; 207 return false;
208 } 208 }
209 } 209 }
210 210
211 // Now update the GrPrimitiveProcessor's batch tracker 211 // Now update the GrPrimitiveProcessor's batch tracker
212 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker()); 212 fPrimitiveProcessor->makeEqual(&fBatchTracker, that.getBatchTracker());
213 return true; 213 return true;
214 } 214 }
215 215
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698