| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrBezierEffect.h" | 8 #include "GrBezierEffect.h" |
| 9 | 9 |
| 10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const GrGLCaps& caps, | 133 const GrGLCaps& caps, |
| 134 GrProcessorKeyBuilder* b) const { | 134 GrProcessorKeyBuilder* b) const { |
| 135 GrGLConicEffect::GenKey(*this, bt, caps, b); | 135 GrGLConicEffect::GenKey(*this, bt, caps, b); |
| 136 } | 136 } |
| 137 | 137 |
| 138 GrGLGeometryProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt)
const { | 138 GrGLGeometryProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt)
const { |
| 139 return SkNEW_ARGS(GrGLConicEffect, (*this, bt)); | 139 return SkNEW_ARGS(GrGLConicEffect, (*this, bt)); |
| 140 } | 140 } |
| 141 | 141 |
| 142 GrConicEffect::GrConicEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeTyp
e edgeType) | 142 GrConicEffect::GrConicEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeTyp
e edgeType) |
| 143 : INHERITED(color, coverage), fEdgeType(edgeType) { | 143 : INHERITED(color, false, coverage), fEdgeType(edgeType) { |
| 144 this->initClassID<GrConicEffect>(); | 144 this->initClassID<GrConicEffect>(); |
| 145 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert
exAttribType)); | 145 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert
exAttribType)); |
| 146 fInConicCoeffs = &this->addVertexAttrib(GrAttribute("inConicCoeffs", | 146 fInConicCoeffs = &this->addVertexAttrib(GrAttribute("inConicCoeffs", |
| 147 kVec4f_GrVertexAttribTyp
e)); | 147 kVec4f_GrVertexAttribTyp
e)); |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool GrConicEffect::onIsEqual(const GrGeometryProcessor& other) const { | 150 bool GrConicEffect::onIsEqual(const GrGeometryProcessor& other) const { |
| 151 const GrConicEffect& ce = other.cast<GrConicEffect>(); | 151 const GrConicEffect& ce = other.cast<GrConicEffect>(); |
| 152 return (ce.fEdgeType == fEdgeType); | 152 return (ce.fEdgeType == fEdgeType); |
| 153 } | 153 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 const GrGLCaps& caps, | 280 const GrGLCaps& caps, |
| 281 GrProcessorKeyBuilder* b) const { | 281 GrProcessorKeyBuilder* b) const { |
| 282 GrGLQuadEffect::GenKey(*this, bt, caps, b); | 282 GrGLQuadEffect::GenKey(*this, bt, caps, b); |
| 283 } | 283 } |
| 284 | 284 |
| 285 GrGLGeometryProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt)
const { | 285 GrGLGeometryProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt)
const { |
| 286 return SkNEW_ARGS(GrGLQuadEffect, (*this, bt)); | 286 return SkNEW_ARGS(GrGLQuadEffect, (*this, bt)); |
| 287 } | 287 } |
| 288 | 288 |
| 289 GrQuadEffect::GrQuadEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeType
edgeType) | 289 GrQuadEffect::GrQuadEffect(GrColor color, uint8_t coverage, GrPrimitiveEdgeType
edgeType) |
| 290 : INHERITED(color, coverage), fEdgeType(edgeType) { | 290 : INHERITED(color, false, coverage), fEdgeType(edgeType) { |
| 291 this->initClassID<GrQuadEffect>(); | 291 this->initClassID<GrQuadEffect>(); |
| 292 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert
exAttribType)); | 292 fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVert
exAttribType)); |
| 293 fInHairQuadEdge = &this->addVertexAttrib(GrAttribute("inHairQuadEdge", | 293 fInHairQuadEdge = &this->addVertexAttrib(GrAttribute("inHairQuadEdge", |
| 294 kVec4f_GrVertexAttribTyp
e)); | 294 kVec4f_GrVertexAttribTyp
e)); |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool GrQuadEffect::onIsEqual(const GrGeometryProcessor& other) const { | 297 bool GrQuadEffect::onIsEqual(const GrGeometryProcessor& other) const { |
| 298 const GrQuadEffect& ce = other.cast<GrQuadEffect>(); | 298 const GrQuadEffect& ce = other.cast<GrQuadEffect>(); |
| 299 return (ce.fEdgeType == fEdgeType); | 299 return (ce.fEdgeType == fEdgeType); |
| 300 } | 300 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 GrTexture*[]) { | 497 GrTexture*[]) { |
| 498 GrGeometryProcessor* gp; | 498 GrGeometryProcessor* gp; |
| 499 do { | 499 do { |
| 500 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( | 500 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( |
| 501 random->nextULessThan(kGrPro
cessorEdgeTypeCnt)); | 501 random->nextULessThan(kGrPro
cessorEdgeTypeCnt)); |
| 502 gp = GrCubicEffect::Create(GrRandomColor(random), edgeType, caps); | 502 gp = GrCubicEffect::Create(GrRandomColor(random), edgeType, caps); |
| 503 } while (NULL == gp); | 503 } while (NULL == gp); |
| 504 return gp; | 504 return gp; |
| 505 } | 505 } |
| 506 | 506 |
| OLD | NEW |