| OLD | NEW |
| 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 "GrRODrawState.h" | 8 #include "GrRODrawState.h" |
| 9 #include "GrDrawTargetCaps.h" | 9 #include "GrDrawTargetCaps.h" |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 bool GrRODrawState::validateVertexAttribs() const { | 75 bool GrRODrawState::validateVertexAttribs() const { |
| 76 // check consistency of effects and attributes | 76 // check consistency of effects and attributes |
| 77 GrSLType slTypes[kMaxVertexAttribCnt]; | 77 GrSLType slTypes[kMaxVertexAttribCnt]; |
| 78 for (int i = 0; i < kMaxVertexAttribCnt; ++i) { | 78 for (int i = 0; i < kMaxVertexAttribCnt; ++i) { |
| 79 slTypes[i] = static_cast<GrSLType>(-1); | 79 slTypes[i] = static_cast<GrSLType>(-1); |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (this->hasGeometryProcessor()) { | 82 if (this->hasGeometryProcessor()) { |
| 83 const GrEffectStage& stage = *this->getGeometryProcessor(); | 83 const GrEffectStage& stage = *this->getGeometryProcessor(); |
| 84 const GrEffect* effect = stage.getEffect(); | 84 const GrEffect* effect = stage.getEffect(); |
| 85 SkASSERT(NULL != effect); | 85 SkASSERT(effect); |
| 86 // make sure that any attribute indices have the correct binding type, t
hat the attrib | 86 // make sure that any attribute indices have the correct binding type, t
hat the attrib |
| 87 // type and effect's shader lang type are compatible, and that attribute
s shared by | 87 // type and effect's shader lang type are compatible, and that attribute
s shared by |
| 88 // multiple effects use the same shader lang type. | 88 // multiple effects use the same shader lang type. |
| 89 const int* attributeIndices = stage.getVertexAttribIndices(); | 89 const int* attributeIndices = stage.getVertexAttribIndices(); |
| 90 int numAttributes = stage.getVertexAttribIndexCount(); | 90 int numAttributes = stage.getVertexAttribIndexCount(); |
| 91 for (int i = 0; i < numAttributes; ++i) { | 91 for (int i = 0; i < numAttributes; ++i) { |
| 92 int attribIndex = attributeIndices[i]; | 92 int attribIndex = attributeIndices[i]; |
| 93 if (attribIndex >= fVACount || | 93 if (attribIndex >= fVACount || |
| 94 kEffect_GrVertexAttribBinding != fVAPtr[attribIndex].fBinding) { | 94 kEffect_GrVertexAttribBinding != fVAPtr[attribIndex].fBinding) { |
| 95 return false; | 95 return false; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 find that only 1, ISA, and ISC produce the correct destination when applied
to S' and D. | 177 find that only 1, ISA, and ISC produce the correct destination when applied
to S' and D. |
| 178 Also, if we're directly rendering coverage (isCoverageDrawing) then coverag
e is treated as | 178 Also, if we're directly rendering coverage (isCoverageDrawing) then coverag
e is treated as |
| 179 color by definition. | 179 color by definition. |
| 180 */ | 180 */ |
| 181 return kOne_GrBlendCoeff == fDstBlend || | 181 return kOne_GrBlendCoeff == fDstBlend || |
| 182 kISA_GrBlendCoeff == fDstBlend || | 182 kISA_GrBlendCoeff == fDstBlend || |
| 183 kISC_GrBlendCoeff == fDstBlend || | 183 kISC_GrBlendCoeff == fDstBlend || |
| 184 this->isCoverageDrawing(); | 184 this->isCoverageDrawing(); |
| 185 } | 185 } |
| 186 | 186 |
| OLD | NEW |