OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrPipeline.h" | 8 #include "GrPipeline.h" |
9 | 9 |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } else { | 146 } else { |
147 if (coveragePOI.readsFragPosition()) { | 147 if (coveragePOI.readsFragPosition()) { |
148 fReadsFragPosition = true; | 148 fReadsFragPosition = true; |
149 } | 149 } |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 //////////////////////////////////////////////////////////////////////////////// | 153 //////////////////////////////////////////////////////////////////////////////// |
154 | 154 |
155 bool GrPipeline::isEqual(const GrPipeline& that) const { | 155 bool GrPipeline::isEqual(const GrPipeline& that) const { |
| 156 // If we point to the same pipeline, then we are necessarily equal |
| 157 if (this == &that) { |
| 158 return true; |
| 159 } |
| 160 |
156 if (this->getRenderTarget() != that.getRenderTarget() || | 161 if (this->getRenderTarget() != that.getRenderTarget() || |
157 this->fFragmentStages.count() != that.fFragmentStages.count() || | 162 this->fFragmentStages.count() != that.fFragmentStages.count() || |
158 this->fNumColorStages != that.fNumColorStages || | 163 this->fNumColorStages != that.fNumColorStages || |
159 this->fScissorState != that.fScissorState || | 164 this->fScissorState != that.fScissorState || |
160 this->fFlags != that.fFlags || | 165 this->fFlags != that.fFlags || |
161 this->fStencilSettings != that.fStencilSettings || | 166 this->fStencilSettings != that.fStencilSettings || |
162 this->fDrawFace != that.fDrawFace) { | 167 this->fDrawFace != that.fDrawFace) { |
163 return false; | 168 return false; |
164 } | 169 } |
165 | 170 |
166 if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) { | 171 if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) { |
167 return false; | 172 return false; |
168 } | 173 } |
169 | 174 |
170 // The program desc comparison should have already assured that the stage co
unts match. | 175 // The program desc comparison should have already assured that the stage co
unts match. |
171 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); | 176 SkASSERT(this->numFragmentStages() == that.numFragmentStages()); |
172 for (int i = 0; i < this->numFragmentStages(); i++) { | 177 for (int i = 0; i < this->numFragmentStages(); i++) { |
173 | 178 |
174 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { | 179 if (this->getFragmentStage(i) != that.getFragmentStage(i)) { |
175 return false; | 180 return false; |
176 } | 181 } |
177 } | 182 } |
178 return true; | 183 return true; |
179 } | 184 } |
180 | 185 |
OLD | NEW |