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/GrGLFragmentProcessor.h" | 10 #include "gl/GrGLFragmentProcessor.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 GrConicEffect::~GrConicEffect() {} | 187 GrConicEffect::~GrConicEffect() {} |
188 | 188 |
189 void GrConicEffect::getGLProcessorKey(const GrBatchTracker& bt, | 189 void GrConicEffect::getGLProcessorKey(const GrBatchTracker& bt, |
190 const GrGLSLCaps& caps, | 190 const GrGLSLCaps& caps, |
191 GrProcessorKeyBuilder* b) const { | 191 GrProcessorKeyBuilder* b) const { |
192 GrGLConicEffect::GenKey(*this, bt, caps, b); | 192 GrGLConicEffect::GenKey(*this, bt, caps, b); |
193 } | 193 } |
194 | 194 |
195 GrGLPrimitiveProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt
, | 195 GrGLPrimitiveProcessor* GrConicEffect::createGLInstance(const GrBatchTracker& bt
, |
196 const GrGLSLCaps&) const
{ | 196 const GrGLSLCaps&) const
{ |
197 return SkNEW_ARGS(GrGLConicEffect, (*this, bt)); | 197 return new GrGLConicEffect(*this, bt); |
198 } | 198 } |
199 | 199 |
200 GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t
coverage, | 200 GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t
coverage, |
201 GrPrimitiveEdgeType edgeType, const SkMatrix& local
Matrix, | 201 GrPrimitiveEdgeType edgeType, const SkMatrix& local
Matrix, |
202 bool usesLocalCoords) | 202 bool usesLocalCoords) |
203 : fColor(color) | 203 : fColor(color) |
204 , fViewMatrix(viewMatrix) | 204 , fViewMatrix(viewMatrix) |
205 , fLocalMatrix(viewMatrix) | 205 , fLocalMatrix(viewMatrix) |
206 , fUsesLocalCoords(usesLocalCoords) | 206 , fUsesLocalCoords(usesLocalCoords) |
207 , fCoverageScale(coverage) | 207 , fCoverageScale(coverage) |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 GrQuadEffect::~GrQuadEffect() {} | 395 GrQuadEffect::~GrQuadEffect() {} |
396 | 396 |
397 void GrQuadEffect::getGLProcessorKey(const GrBatchTracker& bt, | 397 void GrQuadEffect::getGLProcessorKey(const GrBatchTracker& bt, |
398 const GrGLSLCaps& caps, | 398 const GrGLSLCaps& caps, |
399 GrProcessorKeyBuilder* b) const { | 399 GrProcessorKeyBuilder* b) const { |
400 GrGLQuadEffect::GenKey(*this, bt, caps, b); | 400 GrGLQuadEffect::GenKey(*this, bt, caps, b); |
401 } | 401 } |
402 | 402 |
403 GrGLPrimitiveProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt, | 403 GrGLPrimitiveProcessor* GrQuadEffect::createGLInstance(const GrBatchTracker& bt, |
404 const GrGLSLCaps&) const
{ | 404 const GrGLSLCaps&) const
{ |
405 return SkNEW_ARGS(GrGLQuadEffect, (*this, bt)); | 405 return new GrGLQuadEffect(*this, bt); |
406 } | 406 } |
407 | 407 |
408 GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t co
verage, | 408 GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t co
verage, |
409 GrPrimitiveEdgeType edgeType, const SkMatrix& localMa
trix, | 409 GrPrimitiveEdgeType edgeType, const SkMatrix& localMa
trix, |
410 bool usesLocalCoords) | 410 bool usesLocalCoords) |
411 : fColor(color) | 411 : fColor(color) |
412 , fViewMatrix(viewMatrix) | 412 , fViewMatrix(viewMatrix) |
413 , fLocalMatrix(localMatrix) | 413 , fLocalMatrix(localMatrix) |
414 , fUsesLocalCoords(usesLocalCoords) | 414 , fUsesLocalCoords(usesLocalCoords) |
415 , fCoverageScale(coverage) | 415 , fCoverageScale(coverage) |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 GrCubicEffect::~GrCubicEffect() {} | 619 GrCubicEffect::~GrCubicEffect() {} |
620 | 620 |
621 void GrCubicEffect::getGLProcessorKey(const GrBatchTracker& bt, | 621 void GrCubicEffect::getGLProcessorKey(const GrBatchTracker& bt, |
622 const GrGLSLCaps& caps, | 622 const GrGLSLCaps& caps, |
623 GrProcessorKeyBuilder* b) const { | 623 GrProcessorKeyBuilder* b) const { |
624 GrGLCubicEffect::GenKey(*this, bt, caps, b); | 624 GrGLCubicEffect::GenKey(*this, bt, caps, b); |
625 } | 625 } |
626 | 626 |
627 GrGLPrimitiveProcessor* GrCubicEffect::createGLInstance(const GrBatchTracker& bt
, | 627 GrGLPrimitiveProcessor* GrCubicEffect::createGLInstance(const GrBatchTracker& bt
, |
628 const GrGLSLCaps&) const
{ | 628 const GrGLSLCaps&) const
{ |
629 return SkNEW_ARGS(GrGLCubicEffect, (*this, bt)); | 629 return new GrGLCubicEffect(*this, bt); |
630 } | 630 } |
631 | 631 |
632 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, | 632 GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix, |
633 GrPrimitiveEdgeType edgeType) | 633 GrPrimitiveEdgeType edgeType) |
634 : fColor(color) | 634 : fColor(color) |
635 , fViewMatrix(viewMatrix) | 635 , fViewMatrix(viewMatrix) |
636 , fEdgeType(edgeType) { | 636 , fEdgeType(edgeType) { |
637 this->initClassID<GrCubicEffect>(); | 637 this->initClassID<GrCubicEffect>(); |
638 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, | 638 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, |
639 kHigh_GrSLPrecision)); | 639 kHigh_GrSLPrecision)); |
(...skipping 10 matching lines...) Expand all Loading... |
650 do { | 650 do { |
651 GrPrimitiveEdgeType edgeType = | 651 GrPrimitiveEdgeType edgeType = |
652 static_cast<GrPrimitiveEdgeType>( | 652 static_cast<GrPrimitiveEdgeType>( |
653 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); | 653 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); |
654 gp = GrCubicEffect::Create(GrRandomColor(d->fRandom), | 654 gp = GrCubicEffect::Create(GrRandomColor(d->fRandom), |
655 GrTest::TestMatrix(d->fRandom), edgeType, *d-
>fCaps); | 655 GrTest::TestMatrix(d->fRandom), edgeType, *d-
>fCaps); |
656 } while (NULL == gp); | 656 } while (NULL == gp); |
657 return gp; | 657 return gp; |
658 } | 658 } |
659 | 659 |
OLD | NEW |