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 "GrDistanceFieldGeoProc.h" | 8 #include "GrDistanceFieldGeoProc.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 const SkMatrix& viewM
atrix, | 222 const SkMatrix& viewM
atrix, |
223 GrTexture* texture, | 223 GrTexture* texture, |
224 const GrTextureParams
& params, | 224 const GrTextureParams
& params, |
225 #ifdef SK_GAMMA_APPLY_TO_A8 | 225 #ifdef SK_GAMMA_APPLY_TO_A8 |
226 float distanceAdjust, | 226 float distanceAdjust, |
227 #endif | 227 #endif |
228 uint32_t flags, | 228 uint32_t flags, |
229 bool usesLocalCoords) | 229 bool usesLocalCoords) |
230 : fColor(color) | 230 : fColor(color) |
231 , fViewMatrix(viewMatrix) | 231 , fViewMatrix(viewMatrix) |
232 , fTextureAccess(texture, params) | 232 , fTextureAccess(texture, nullptr, params) |
233 #ifdef SK_GAMMA_APPLY_TO_A8 | 233 #ifdef SK_GAMMA_APPLY_TO_A8 |
234 , fDistanceAdjust(distanceAdjust) | 234 , fDistanceAdjust(distanceAdjust) |
235 #endif | 235 #endif |
236 , fFlags(flags & kNonLCD_DistanceFieldEffectMask) | 236 , fFlags(flags & kNonLCD_DistanceFieldEffectMask) |
237 , fInColor(nullptr) | 237 , fInColor(nullptr) |
238 , fUsesLocalCoords(usesLocalCoords) { | 238 , fUsesLocalCoords(usesLocalCoords) { |
239 SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask)); | 239 SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask)); |
240 this->initClassID<GrDistanceFieldA8TextGeoProc>(); | 240 this->initClassID<GrDistanceFieldA8TextGeoProc>(); |
241 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, | 241 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, |
242 kHigh_GrSLPrecision)); | 242 kHigh_GrSLPrecision)); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc( | 464 GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc( |
465 GrColor color, | 465 GrColor color, |
466 const SkMatrix& viewMatrix, | 466 const SkMatrix& viewMatrix, |
467 GrTexture* texture, | 467 GrTexture* texture, |
468 const GrTextureParams& params, | 468 const GrTextureParams& params, |
469 uint32_t flags, | 469 uint32_t flags, |
470 bool usesLocalCoords) | 470 bool usesLocalCoords) |
471 : fColor(color) | 471 : fColor(color) |
472 , fViewMatrix(viewMatrix) | 472 , fViewMatrix(viewMatrix) |
473 , fTextureAccess(texture, params) | 473 , fTextureAccess(texture, nullptr, params) |
474 , fFlags(flags & kNonLCD_DistanceFieldEffectMask) | 474 , fFlags(flags & kNonLCD_DistanceFieldEffectMask) |
475 , fInColor(nullptr) | 475 , fInColor(nullptr) |
476 , fUsesLocalCoords(usesLocalCoords) { | 476 , fUsesLocalCoords(usesLocalCoords) { |
477 SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask)); | 477 SkASSERT(!(flags & ~kNonLCD_DistanceFieldEffectMask)); |
478 this->initClassID<GrDistanceFieldPathGeoProc>(); | 478 this->initClassID<GrDistanceFieldPathGeoProc>(); |
479 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, | 479 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, |
480 kHigh_GrSLPrecision)); | 480 kHigh_GrSLPrecision)); |
481 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttri
bType)); | 481 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttri
bType)); |
482 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", | 482 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", |
483 kVec2f_GrVertexAttribTyp
e)); | 483 kVec2f_GrVertexAttribTyp
e)); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 | 759 |
760 /////////////////////////////////////////////////////////////////////////////// | 760 /////////////////////////////////////////////////////////////////////////////// |
761 | 761 |
762 GrDistanceFieldLCDTextGeoProc::GrDistanceFieldLCDTextGeoProc( | 762 GrDistanceFieldLCDTextGeoProc::GrDistanceFieldLCDTextGeoProc( |
763 GrColor color, const SkMatrix&
viewMatrix, | 763 GrColor color, const SkMatrix&
viewMatrix, |
764 GrTexture* texture, const GrTe
xtureParams& params, | 764 GrTexture* texture, const GrTe
xtureParams& params, |
765 DistanceAdjust distanceAdjust, | 765 DistanceAdjust distanceAdjust, |
766 uint32_t flags, bool usesLocal
Coords) | 766 uint32_t flags, bool usesLocal
Coords) |
767 : fColor(color) | 767 : fColor(color) |
768 , fViewMatrix(viewMatrix) | 768 , fViewMatrix(viewMatrix) |
769 , fTextureAccess(texture, params) | 769 , fTextureAccess(texture, nullptr, params) |
770 , fDistanceAdjust(distanceAdjust) | 770 , fDistanceAdjust(distanceAdjust) |
771 , fFlags(flags & kLCD_DistanceFieldEffectMask) | 771 , fFlags(flags & kLCD_DistanceFieldEffectMask) |
772 , fUsesLocalCoords(usesLocalCoords) { | 772 , fUsesLocalCoords(usesLocalCoords) { |
773 SkASSERT(!(flags & ~kLCD_DistanceFieldEffectMask) && (flags & kUseLCD_Distan
ceFieldEffectFlag)); | 773 SkASSERT(!(flags & ~kLCD_DistanceFieldEffectMask) && (flags & kUseLCD_Distan
ceFieldEffectFlag)); |
774 this->initClassID<GrDistanceFieldLCDTextGeoProc>(); | 774 this->initClassID<GrDistanceFieldLCDTextGeoProc>(); |
775 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, | 775 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex
AttribType, |
776 kHigh_GrSLPrecision)); | 776 kHigh_GrSLPrecision)); |
777 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttri
bType)); | 777 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttri
bType)); |
778 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", | 778 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", |
779 kVec2us_GrVertexAttribTy
pe, | 779 kVec2us_GrVertexAttribTy
pe, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 flags |= d->fRandom->nextBool() ? kScaleOnly_DistanceFieldEffectFlag : 0
; | 815 flags |= d->fRandom->nextBool() ? kScaleOnly_DistanceFieldEffectFlag : 0
; |
816 } | 816 } |
817 flags |= d->fRandom->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; | 817 flags |= d->fRandom->nextBool() ? kBGR_DistanceFieldEffectFlag : 0; |
818 return GrDistanceFieldLCDTextGeoProc::Make(GrRandomColor(d->fRandom), | 818 return GrDistanceFieldLCDTextGeoProc::Make(GrRandomColor(d->fRandom), |
819 GrTest::TestMatrix(d->fRandom), | 819 GrTest::TestMatrix(d->fRandom), |
820 d->fTextures[texIdx], params, | 820 d->fTextures[texIdx], params, |
821 wa, | 821 wa, |
822 flags, | 822 flags, |
823 d->fRandom->nextBool()); | 823 d->fRandom->nextBool()); |
824 } | 824 } |
OLD | NEW |