| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrDrawState.h" | 8 #include "GrDrawState.h" |
| 9 #include "GrPaint.h" | 9 #include "GrPaint.h" |
| 10 | 10 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return false; | 156 return false; |
| 157 } | 157 } |
| 158 slTypes[attribIndex] = effectSLType; | 158 slTypes[attribIndex] = effectSLType; |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 return true; | 163 return true; |
| 164 } | 164 } |
| 165 | 165 |
| 166 bool GrDrawState::willEffectReadDstColor() const { |
| 167 int startStage = this->isColorWriteDisabled() ? this->getFirstCoverageStage(
) : 0; |
| 168 for (int s = startStage; s < kNumStages; ++s) { |
| 169 if (this->isStageEnabled(s) && (*this->getStage(s).getEffect())->willRea
dDstColor()) { |
| 170 return true; |
| 171 } |
| 172 } |
| 173 return false; |
| 174 } |
| 175 |
| 166 //////////////////////////////////////////////////////////////////////////////// | 176 //////////////////////////////////////////////////////////////////////////////// |
| 167 | 177 |
| 168 bool GrDrawState::srcAlphaWillBeOne() const { | 178 bool GrDrawState::srcAlphaWillBeOne() const { |
| 169 uint32_t validComponentFlags; | 179 uint32_t validComponentFlags; |
| 170 GrColor color; | 180 GrColor color; |
| 171 // Check if per-vertex or constant color may have partial alpha | 181 // Check if per-vertex or constant color may have partial alpha |
| 172 if (this->hasColorVertexAttribute()) { | 182 if (this->hasColorVertexAttribute()) { |
| 173 validComponentFlags = 0; | 183 validComponentFlags = 0; |
| 174 color = 0; // not strictly necessary but we get false alarms from tools
about uninit. | 184 color = 0; // not strictly necessary but we get false alarms from tools
about uninit. |
| 175 } else { | 185 } else { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 449 } |
| 440 fRestoreMask |= (1 << s); | 450 fRestoreMask |= (1 << s); |
| 441 GrEffectStage* stage = drawState->fStages + s; | 451 GrEffectStage* stage = drawState->fStages + s; |
| 442 stage->saveCoordChange(&fSavedCoordChanges[s]); | 452 stage->saveCoordChange(&fSavedCoordChanges[s]); |
| 443 stage->localCoordChange(invVM); | 453 stage->localCoordChange(invVM); |
| 444 } | 454 } |
| 445 } | 455 } |
| 446 drawState->viewMatrix()->reset(); | 456 drawState->viewMatrix()->reset(); |
| 447 return true; | 457 return true; |
| 448 } | 458 } |
| OLD | NEW |