| 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 | 9 |
| 10 #include "GrOptDrawState.h" | 10 #include "GrOptDrawState.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 fHints = 0; | 229 fHints = 0; |
| 230 | 230 |
| 231 // Enable the clip bit | 231 // Enable the clip bit |
| 232 this->enableState(GrDrawState::kClip_StateBit); | 232 this->enableState(GrDrawState::kClip_StateBit); |
| 233 | 233 |
| 234 this->setColor(paint.getColor()); | 234 this->setColor(paint.getColor()); |
| 235 this->setState(GrDrawState::kDither_StateBit, paint.isDither()); | 235 this->setState(GrDrawState::kDither_StateBit, paint.isDither()); |
| 236 this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias()); | 236 this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias()); |
| 237 | 237 |
| 238 this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); | 238 this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); |
| 239 this->setCoverage(paint.getCoverage()); | 239 this->setCoverage(0xFF); |
| 240 } | 240 } |
| 241 | 241 |
| 242 //////////////////////////////////////////////////////////////////////////////// | 242 //////////////////////////////////////////////////////////////////////////////// |
| 243 | 243 |
| 244 bool GrDrawState::validateVertexAttribs() const { | 244 bool GrDrawState::validateVertexAttribs() const { |
| 245 // check consistency of effects and attributes | 245 // check consistency of effects and attributes |
| 246 GrSLType slTypes[kMaxVertexAttribCnt]; | 246 GrSLType slTypes[kMaxVertexAttribCnt]; |
| 247 for (int i = 0; i < kMaxVertexAttribCnt; ++i) { | 247 for (int i = 0; i < kMaxVertexAttribCnt; ++i) { |
| 248 slTypes[i] = static_cast<GrSLType>(-1); | 248 slTypes[i] = static_cast<GrSLType>(-1); |
| 249 } | 249 } |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 } | 735 } |
| 736 | 736 |
| 737 // Since the shader will multiply coverage and color, the only way the f
inal A==1 is if | 737 // Since the shader will multiply coverage and color, the only way the f
inal A==1 is if |
| 738 // coverage and color both have A==1. | 738 // coverage and color both have A==1. |
| 739 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); | 739 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); |
| 740 } | 740 } |
| 741 | 741 |
| 742 return inoutColor.isOpaque(); | 742 return inoutColor.isOpaque(); |
| 743 } | 743 } |
| 744 | 744 |
| OLD | NEW |