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

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

Issue 864853002: remove drawType from optState (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleaning 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/GrOptDrawState.h ('k') | src/gpu/gl/GrGLGpu.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"
11 #include "GrDrawTargetCaps.h" 11 #include "GrDrawTargetCaps.h"
12 #include "GrGpu.h" 12 #include "GrGpu.h"
13 #include "GrProcOptInfo.h" 13 #include "GrProcOptInfo.h"
14 #include "GrXferProcessor.h" 14 #include "GrXferProcessor.h"
15 15
16 GrOptDrawState::GrOptDrawState(const GrDrawState& drawState, 16 GrOptDrawState::GrOptDrawState(const GrDrawState& drawState,
17 const GrPrimitiveProcessor* primProc, 17 const GrPrimitiveProcessor* primProc,
18 const GrDrawTargetCaps& caps, 18 const GrDrawTargetCaps& caps,
19 const GrScissorState& scissorState, 19 const GrScissorState& scissorState,
20 const GrDeviceCoordTexture* dstCopy, 20 const GrDeviceCoordTexture* dstCopy) {
21 GrGpu::DrawType drawType) {
22 fDrawType = drawType;
23
24 const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc); 21 const GrProcOptInfo& colorPOI = drawState.colorProcInfo(primProc);
25 const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc); 22 const GrProcOptInfo& coveragePOI = drawState.coverageProcInfo(primProc);
26 23
27 // Create XferProcessor from DS's XPFactory 24 // Create XferProcessor from DS's XPFactory
28 SkAutoTUnref<GrXferProcessor> xferProcessor( 25 SkAutoTUnref<GrXferProcessor> xferProcessor(
29 drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI)); 26 drawState.getXPFactory()->createXferProcessor(colorPOI, coveragePOI));
30 27
31 GrColor overrideColor = GrColor_ILLEGAL; 28 GrColor overrideColor = GrColor_ILLEGAL;
32 if (colorPOI.firstEffectiveStageIndex() != 0) { 29 if (colorPOI.firstEffectiveStageIndex() != 0) {
33 overrideColor = colorPOI.inputColorToEffectiveStage(); 30 overrideColor = colorPOI.inputColorToEffectiveStage();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 135 }
139 } 136 }
140 137
141 //////////////////////////////////////////////////////////////////////////////// 138 ////////////////////////////////////////////////////////////////////////////////
142 139
143 bool GrOptDrawState::isEqual(const GrOptDrawState& that) const { 140 bool GrOptDrawState::isEqual(const GrOptDrawState& that) const {
144 if (this->getRenderTarget() != that.getRenderTarget() || 141 if (this->getRenderTarget() != that.getRenderTarget() ||
145 this->fFragmentStages.count() != that.fFragmentStages.count() || 142 this->fFragmentStages.count() != that.fFragmentStages.count() ||
146 this->fNumColorStages != that.fNumColorStages || 143 this->fNumColorStages != that.fNumColorStages ||
147 this->fScissorState != that.fScissorState || 144 this->fScissorState != that.fScissorState ||
148 this->fDrawType != that.fDrawType ||
149 this->fFlags != that.fFlags || 145 this->fFlags != that.fFlags ||
150 this->fStencilSettings != that.fStencilSettings || 146 this->fStencilSettings != that.fStencilSettings ||
151 this->fDrawFace != that.fDrawFace || 147 this->fDrawFace != that.fDrawFace ||
152 this->fDstCopy.texture() != that.fDstCopy.texture()) { 148 this->fDstCopy.texture() != that.fDstCopy.texture()) {
153 return false; 149 return false;
154 } 150 }
155 151
156 if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) { 152 if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) {
157 return false; 153 return false;
158 } 154 }
159 155
160 // The program desc comparison should have already assured that the stage co unts match. 156 // The program desc comparison should have already assured that the stage co unts match.
161 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); 157 SkASSERT(this->numFragmentStages() == that.numFragmentStages());
162 for (int i = 0; i < this->numFragmentStages(); i++) { 158 for (int i = 0; i < this->numFragmentStages(); i++) {
163 159
164 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { 160 if (this->getFragmentStage(i) != that.getFragmentStage(i)) {
165 return false; 161 return false;
166 } 162 }
167 } 163 }
168 return true; 164 return true;
169 } 165 }
170 166
OLDNEW
« no previous file with comments | « src/gpu/GrOptDrawState.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698