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 "SkDither.h" | 8 #include "SkDither.h" |
9 #include "SkPerlinNoiseShader.h" | 9 #include "SkPerlinNoiseShader.h" |
10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
11 #include "SkShader.h" | 11 #include "SkShader.h" |
12 #include "SkUnPreMultiply.h" | 12 #include "SkUnPreMultiply.h" |
13 #include "SkString.h" | 13 #include "SkString.h" |
14 | 14 |
15 #if SK_SUPPORT_GPU | 15 #if SK_SUPPORT_GPU |
16 #include "GrContext.h" | 16 #include "GrContext.h" |
| 17 #include "GrCoordTransform.h" |
17 #include "gl/GrGLEffect.h" | 18 #include "gl/GrGLEffect.h" |
18 #include "gl/GrGLEffectMatrix.h" | |
19 #include "GrTBackendEffectFactory.h" | 19 #include "GrTBackendEffectFactory.h" |
20 #include "SkGr.h" | 20 #include "SkGr.h" |
21 #endif | 21 #endif |
22 | 22 |
23 static const int kBlockSize = 256; | 23 static const int kBlockSize = 256; |
24 static const int kBlockMask = kBlockSize - 1; | 24 static const int kBlockMask = kBlockSize - 1; |
25 static const int kPerlinNoise = 4096; | 25 static const int kPerlinNoise = 4096; |
26 static const int kRandMaximum = SK_MaxS32; // 2**31 - 1 | 26 static const int kRandMaximum = SK_MaxS32; // 2**31 - 1 |
27 | 27 |
28 namespace { | 28 namespace { |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 508 |
509 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; | 509 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; |
510 | 510 |
511 protected: | 511 protected: |
512 SkPerlinNoiseShader::Type fType; | 512 SkPerlinNoiseShader::Type fType; |
513 bool fStitchTiles; | 513 bool fStitchTiles; |
514 int fNumOctaves; | 514 int fNumOctaves; |
515 GrGLUniformManager::UniformHandle fBaseFrequencyUni; | 515 GrGLUniformManager::UniformHandle fBaseFrequencyUni; |
516 GrGLUniformManager::UniformHandle fAlphaUni; | 516 GrGLUniformManager::UniformHandle fAlphaUni; |
517 GrGLUniformManager::UniformHandle fInvMatrixUni; | 517 GrGLUniformManager::UniformHandle fInvMatrixUni; |
518 GrGLEffectMatrix fEffectMatrix; | |
519 | 518 |
520 private: | 519 private: |
521 typedef GrGLEffect INHERITED; | 520 typedef GrGLEffect INHERITED; |
522 }; | 521 }; |
523 | 522 |
524 class GrGLPerlinNoise : public GrGLNoise { | 523 class GrGLPerlinNoise : public GrGLNoise { |
525 public: | 524 public: |
526 GrGLPerlinNoise(const GrBackendEffectFactory& factory, | 525 GrGLPerlinNoise(const GrBackendEffectFactory& factory, |
527 const GrDrawEffect& drawEffect) | 526 const GrDrawEffect& drawEffect) |
528 : GrGLNoise(factory, drawEffect) {} | 527 : GrGLNoise(factory, drawEffect) {} |
529 virtual ~GrGLPerlinNoise() {} | 528 virtual ~GrGLPerlinNoise() {} |
530 | 529 |
531 virtual void emitCode(GrGLShaderBuilder*, | 530 virtual void emitCode(GrGLShaderBuilder*, |
532 const GrDrawEffect&, | 531 const GrDrawEffect&, |
533 EffectKey, | 532 EffectKey, |
534 const char* outputColor, | 533 const char* outputColor, |
535 const char* inputColor, | 534 const char* inputColor, |
| 535 const TransformedCoordsArray&, |
536 const TextureSamplerArray&) SK_OVERRIDE; | 536 const TextureSamplerArray&) SK_OVERRIDE; |
537 | 537 |
538 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; | 538 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; |
539 | 539 |
540 private: | 540 private: |
541 GrGLUniformManager::UniformHandle fStitchDataUni; | 541 GrGLUniformManager::UniformHandle fStitchDataUni; |
542 | 542 |
543 typedef GrGLNoise INHERITED; | 543 typedef GrGLNoise INHERITED; |
544 }; | 544 }; |
545 | 545 |
546 class GrGLSimplexNoise : public GrGLNoise { | 546 class GrGLSimplexNoise : public GrGLNoise { |
547 // Note : This is for reference only. GrGLPerlinNoise is used for processing
. | 547 // Note : This is for reference only. GrGLPerlinNoise is used for processing
. |
548 public: | 548 public: |
549 GrGLSimplexNoise(const GrBackendEffectFactory& factory, | 549 GrGLSimplexNoise(const GrBackendEffectFactory& factory, |
550 const GrDrawEffect& drawEffect) | 550 const GrDrawEffect& drawEffect) |
551 : GrGLNoise(factory, drawEffect) {} | 551 : GrGLNoise(factory, drawEffect) {} |
552 | 552 |
553 virtual ~GrGLSimplexNoise() {} | 553 virtual ~GrGLSimplexNoise() {} |
554 | 554 |
555 virtual void emitCode(GrGLShaderBuilder*, | 555 virtual void emitCode(GrGLShaderBuilder*, |
556 const GrDrawEffect&, | 556 const GrDrawEffect&, |
557 EffectKey, | 557 EffectKey, |
558 const char* outputColor, | 558 const char* outputColor, |
559 const char* inputColor, | 559 const char* inputColor, |
| 560 const TransformedCoordsArray&, |
560 const TextureSamplerArray&) SK_OVERRIDE; | 561 const TextureSamplerArray&) SK_OVERRIDE; |
561 | 562 |
562 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; | 563 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; |
563 | 564 |
564 private: | 565 private: |
565 GrGLUniformManager::UniformHandle fSeedUni; | 566 GrGLUniformManager::UniformHandle fSeedUni; |
566 | 567 |
567 typedef GrGLNoise INHERITED; | 568 typedef GrGLNoise INHERITED; |
568 }; | 569 }; |
569 | 570 |
570 ///////////////////////////////////////////////////////////////////// | 571 ///////////////////////////////////////////////////////////////////// |
571 | 572 |
572 class GrNoiseEffect : public GrEffect { | 573 class GrNoiseEffect : public GrEffect { |
573 public: | 574 public: |
574 virtual ~GrNoiseEffect() { } | 575 virtual ~GrNoiseEffect() { } |
575 | 576 |
576 SkPerlinNoiseShader::Type type() const { return fType; } | 577 SkPerlinNoiseShader::Type type() const { return fType; } |
577 bool stitchTiles() const { return fStitchTiles; } | 578 bool stitchTiles() const { return fStitchTiles; } |
578 const SkVector& baseFrequency() const { return fBaseFrequency; } | 579 const SkVector& baseFrequency() const { return fBaseFrequency; } |
579 int numOctaves() const { return fNumOctaves; } | 580 int numOctaves() const { return fNumOctaves; } |
580 const SkMatrix& matrix() const { return fMatrix; } | 581 const SkMatrix& matrix() const { return fCoordTransform.getMatrix(); } |
581 uint8_t alpha() const { return fAlpha; } | 582 uint8_t alpha() const { return fAlpha; } |
582 GrGLEffectMatrix::CoordsType coordsType() const { return GrEffect::kLocal_Co
ordsType; } | |
583 | 583 |
584 void getConstantColorComponents(GrColor*, uint32_t* validFlags) const SK_OVE
RRIDE { | 584 void getConstantColorComponents(GrColor*, uint32_t* validFlags) const SK_OVE
RRIDE { |
585 *validFlags = 0; // This is noise. Nothing is constant. | 585 *validFlags = 0; // This is noise. Nothing is constant. |
586 } | 586 } |
587 | 587 |
588 protected: | 588 protected: |
589 virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { | 589 virtual bool onIsEqual(const GrEffect& sBase) const SK_OVERRIDE { |
590 const GrNoiseEffect& s = CastEffect<GrNoiseEffect>(sBase); | 590 const GrNoiseEffect& s = CastEffect<GrNoiseEffect>(sBase); |
591 return fType == s.fType && | 591 return fType == s.fType && |
592 fBaseFrequency == s.fBaseFrequency && | 592 fBaseFrequency == s.fBaseFrequency && |
593 fNumOctaves == s.fNumOctaves && | 593 fNumOctaves == s.fNumOctaves && |
594 fStitchTiles == s.fStitchTiles && | 594 fStitchTiles == s.fStitchTiles && |
595 fMatrix == s.fMatrix && | 595 fCoordTransform.getMatrix() == s.fCoordTransform.getMatrix() && |
596 fAlpha == s.fAlpha; | 596 fAlpha == s.fAlpha; |
597 } | 597 } |
598 | 598 |
599 GrNoiseEffect(SkPerlinNoiseShader::Type type, const SkVector& baseFrequency,
int numOctaves, | 599 GrNoiseEffect(SkPerlinNoiseShader::Type type, const SkVector& baseFrequency,
int numOctaves, |
600 bool stitchTiles, const SkMatrix& matrix, uint8_t alpha) | 600 bool stitchTiles, const SkMatrix& matrix, uint8_t alpha) |
601 : fType(type) | 601 : fType(type) |
602 , fBaseFrequency(baseFrequency) | 602 , fBaseFrequency(baseFrequency) |
603 , fNumOctaves(numOctaves) | 603 , fNumOctaves(numOctaves) |
604 , fStitchTiles(stitchTiles) | 604 , fStitchTiles(stitchTiles) |
605 , fMatrix(matrix) | 605 , fMatrix(matrix) |
606 , fAlpha(alpha) { | 606 , fAlpha(alpha) { |
| 607 // This (1,1) translation is due to WebKit's 1 based coordinates for the
noise |
| 608 // (as opposed to 0 based, usually). The same adjustment is in the shade
Span() functions. |
| 609 SkMatrix m = matrix; |
| 610 m.postTranslate(SK_Scalar1, SK_Scalar1); |
| 611 fCoordTransform.reset(kLocal_GrCoordSet, m); |
| 612 this->addCoordTransform(&fCoordTransform); |
607 } | 613 } |
608 | 614 |
609 SkPerlinNoiseShader::Type fType; | 615 SkPerlinNoiseShader::Type fType; |
| 616 GrCoordTransform fCoordTransform; |
610 SkVector fBaseFrequency; | 617 SkVector fBaseFrequency; |
611 int fNumOctaves; | 618 int fNumOctaves; |
612 bool fStitchTiles; | 619 bool fStitchTiles; |
613 SkMatrix fMatrix; | 620 SkMatrix fMatrix; |
614 uint8_t fAlpha; | 621 uint8_t fAlpha; |
615 | 622 |
616 private: | 623 private: |
617 typedef GrEffect INHERITED; | 624 typedef GrEffect INHERITED; |
618 }; | 625 }; |
619 | 626 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 return effect; | 746 return effect; |
740 } | 747 } |
741 | 748 |
742 ///////////////////////////////////////////////////////////////////// | 749 ///////////////////////////////////////////////////////////////////// |
743 | 750 |
744 void GrGLSimplexNoise::emitCode(GrGLShaderBuilder* builder, | 751 void GrGLSimplexNoise::emitCode(GrGLShaderBuilder* builder, |
745 const GrDrawEffect&, | 752 const GrDrawEffect&, |
746 EffectKey key, | 753 EffectKey key, |
747 const char* outputColor, | 754 const char* outputColor, |
748 const char* inputColor, | 755 const char* inputColor, |
| 756 const TransformedCoordsArray& coords, |
749 const TextureSamplerArray&) { | 757 const TextureSamplerArray&) { |
750 sk_ignore_unused_variable(inputColor); | 758 sk_ignore_unused_variable(inputColor); |
751 | 759 |
752 SkString vCoords; | 760 SkString vCoords = builder->ensureFSCoords2D(coords, 0); |
753 fEffectMatrix.emitCodeMakeFSCoords2D(builder, key, &vCoords); | |
754 | 761 |
755 fSeedUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, | 762 fSeedUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, |
756 kFloat_GrSLType, "seed"); | 763 kFloat_GrSLType, "seed"); |
757 const char* seedUni = builder->getUniformCStr(fSeedUni); | 764 const char* seedUni = builder->getUniformCStr(fSeedUni); |
758 fInvMatrixUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, | 765 fInvMatrixUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, |
759 kMat33f_GrSLType, "invMatrix"); | 766 kMat33f_GrSLType, "invMatrix"); |
760 const char* invMatrixUni = builder->getUniformCStr(fInvMatrixUni); | 767 const char* invMatrixUni = builder->getUniformCStr(fInvMatrixUni); |
761 fBaseFrequencyUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibil
ity, | 768 fBaseFrequencyUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibil
ity, |
762 kVec2f_GrSLType, "baseFrequency"); | 769 kVec2f_GrSLType, "baseFrequency"); |
763 const char* baseFrequencyUni = builder->getUniformCStr(fBaseFrequencyUni); | 770 const char* baseFrequencyUni = builder->getUniformCStr(fBaseFrequencyUni); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 // Pre-multiply the result | 962 // Pre-multiply the result |
956 builder->fsCodeAppendf("\t\t%s = vec4(%s.rgb * %s.aaa, %s.a);\n", | 963 builder->fsCodeAppendf("\t\t%s = vec4(%s.rgb * %s.aaa, %s.a);\n", |
957 outputColor, outputColor, outputColor, outputColor); | 964 outputColor, outputColor, outputColor, outputColor); |
958 } | 965 } |
959 | 966 |
960 void GrGLPerlinNoise::emitCode(GrGLShaderBuilder* builder, | 967 void GrGLPerlinNoise::emitCode(GrGLShaderBuilder* builder, |
961 const GrDrawEffect&, | 968 const GrDrawEffect&, |
962 EffectKey key, | 969 EffectKey key, |
963 const char* outputColor, | 970 const char* outputColor, |
964 const char* inputColor, | 971 const char* inputColor, |
| 972 const TransformedCoordsArray& coords, |
965 const TextureSamplerArray& samplers) { | 973 const TextureSamplerArray& samplers) { |
966 sk_ignore_unused_variable(inputColor); | 974 sk_ignore_unused_variable(inputColor); |
967 | 975 |
968 SkString vCoords; | 976 SkString vCoords = builder->ensureFSCoords2D(coords, 0); |
969 fEffectMatrix.emitCodeMakeFSCoords2D(builder, key, &vCoords); | |
970 | 977 |
971 fInvMatrixUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, | 978 fInvMatrixUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, |
972 kMat33f_GrSLType, "invMatrix"); | 979 kMat33f_GrSLType, "invMatrix"); |
973 const char* invMatrixUni = builder->getUniformCStr(fInvMatrixUni); | 980 const char* invMatrixUni = builder->getUniformCStr(fInvMatrixUni); |
974 fBaseFrequencyUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibil
ity, | 981 fBaseFrequencyUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibil
ity, |
975 kVec2f_GrSLType, "baseFrequency"); | 982 kVec2f_GrSLType, "baseFrequency"); |
976 const char* baseFrequencyUni = builder->getUniformCStr(fBaseFrequencyUni); | 983 const char* baseFrequencyUni = builder->getUniformCStr(fBaseFrequencyUni); |
977 fAlphaUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, | 984 fAlphaUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility, |
978 kFloat_GrSLType, "alpha"); | 985 kFloat_GrSLType, "alpha"); |
979 const char* alphaUni = builder->getUniformCStr(fAlphaUni); | 986 const char* alphaUni = builder->getUniformCStr(fAlphaUni); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 | 1217 |
1211 // Pre-multiply the result | 1218 // Pre-multiply the result |
1212 builder->fsCodeAppendf("\n\t\t%s = vec4(%s.rgb * %s.aaa, %s.a);\n", | 1219 builder->fsCodeAppendf("\n\t\t%s = vec4(%s.rgb * %s.aaa, %s.a);\n", |
1213 outputColor, outputColor, outputColor, outputColor); | 1220 outputColor, outputColor, outputColor, outputColor); |
1214 } | 1221 } |
1215 | 1222 |
1216 GrGLNoise::GrGLNoise(const GrBackendEffectFactory& factory, const GrDrawEffect&
drawEffect) | 1223 GrGLNoise::GrGLNoise(const GrBackendEffectFactory& factory, const GrDrawEffect&
drawEffect) |
1217 : INHERITED (factory) | 1224 : INHERITED (factory) |
1218 , fType(drawEffect.castEffect<GrPerlinNoiseEffect>().type()) | 1225 , fType(drawEffect.castEffect<GrPerlinNoiseEffect>().type()) |
1219 , fStitchTiles(drawEffect.castEffect<GrPerlinNoiseEffect>().stitchTiles()) | 1226 , fStitchTiles(drawEffect.castEffect<GrPerlinNoiseEffect>().stitchTiles()) |
1220 , fNumOctaves(drawEffect.castEffect<GrPerlinNoiseEffect>().numOctaves()) | 1227 , fNumOctaves(drawEffect.castEffect<GrPerlinNoiseEffect>().numOctaves()) { |
1221 , fEffectMatrix(drawEffect.castEffect<GrPerlinNoiseEffect>().coordsType()) { | |
1222 } | 1228 } |
1223 | 1229 |
1224 GrGLEffect::EffectKey GrGLNoise::GenKey(const GrDrawEffect& drawEffect, const Gr
GLCaps&) { | 1230 GrGLEffect::EffectKey GrGLNoise::GenKey(const GrDrawEffect& drawEffect, const Gr
GLCaps&) { |
1225 const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseE
ffect>(); | 1231 const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseE
ffect>(); |
1226 | 1232 |
1227 EffectKey key = turbulence.numOctaves(); | 1233 EffectKey key = turbulence.numOctaves(); |
1228 | 1234 |
1229 key = key << 3; // Make room for next 3 bits | 1235 key = key << 3; // Make room for next 3 bits |
1230 | 1236 |
1231 switch (turbulence.type()) { | 1237 switch (turbulence.type()) { |
1232 case SkPerlinNoiseShader::kFractalNoise_Type: | 1238 case SkPerlinNoiseShader::kFractalNoise_Type: |
1233 key |= 0x1; | 1239 key |= 0x1; |
1234 break; | 1240 break; |
1235 case SkPerlinNoiseShader::kTurbulence_Type: | 1241 case SkPerlinNoiseShader::kTurbulence_Type: |
1236 key |= 0x2; | 1242 key |= 0x2; |
1237 break; | 1243 break; |
1238 default: | 1244 default: |
1239 // leave key at 0 | 1245 // leave key at 0 |
1240 break; | 1246 break; |
1241 } | 1247 } |
1242 | 1248 |
1243 if (turbulence.stitchTiles()) { | 1249 if (turbulence.stitchTiles()) { |
1244 key |= 0x4; // Flip the 3rd bit if tile stitching is on | 1250 key |= 0x4; // Flip the 3rd bit if tile stitching is on |
1245 } | 1251 } |
1246 | 1252 |
1247 key = key << GrGLEffectMatrix::kKeyBits; | 1253 return key; |
1248 | |
1249 SkMatrix m = turbulence.matrix(); | |
1250 m.postTranslate(SK_Scalar1, SK_Scalar1); | |
1251 return key | GrGLEffectMatrix::GenKey(m, drawEffect, | |
1252 drawEffect.castEffect<GrPerlinNoiseEffect>().coordsType(), NULL
); | |
1253 } | 1254 } |
1254 | 1255 |
1255 void GrGLNoise::setData(const GrGLUniformManager& uman, const GrDrawEffect& draw
Effect) { | 1256 void GrGLNoise::setData(const GrGLUniformManager& uman, const GrDrawEffect& draw
Effect) { |
1256 const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseE
ffect>(); | 1257 const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseE
ffect>(); |
1257 | 1258 |
1258 const SkVector& baseFrequency = turbulence.baseFrequency(); | 1259 const SkVector& baseFrequency = turbulence.baseFrequency(); |
1259 uman.set2f(fBaseFrequencyUni, baseFrequency.fX, baseFrequency.fY); | 1260 uman.set2f(fBaseFrequencyUni, baseFrequency.fX, baseFrequency.fY); |
1260 uman.set1f(fAlphaUni, SkScalarDiv(SkIntToScalar(turbulence.alpha()), SkIntTo
Scalar(255))); | 1261 uman.set1f(fAlphaUni, SkScalarDiv(SkIntToScalar(turbulence.alpha()), SkIntTo
Scalar(255))); |
1261 | 1262 |
1262 SkMatrix m = turbulence.matrix(); | 1263 SkMatrix m = turbulence.matrix(); |
| 1264 m.postTranslate(-SK_Scalar1, -SK_Scalar1); |
1263 SkMatrix invM; | 1265 SkMatrix invM; |
1264 if (!m.invert(&invM)) { | 1266 if (!m.invert(&invM)) { |
1265 invM.reset(); | 1267 invM.reset(); |
1266 } else { | 1268 } else { |
1267 invM.postConcat(invM); // Square the matrix | 1269 invM.postConcat(invM); // Square the matrix |
1268 } | 1270 } |
1269 uman.setSkMatrix(fInvMatrixUni, invM); | 1271 uman.setSkMatrix(fInvMatrixUni, invM); |
1270 | |
1271 // This (1,1) translation is due to WebKit's 1 based coordinates for the noi
se | |
1272 // (as opposed to 0 based, usually). The same adjustment is in the shadeSpan
() functions. | |
1273 m.postTranslate(SK_Scalar1, SK_Scalar1); | |
1274 fEffectMatrix.setData(uman, m, drawEffect, NULL); | |
1275 } | 1272 } |
1276 | 1273 |
1277 void GrGLPerlinNoise::setData(const GrGLUniformManager& uman, const GrDrawEffect
& drawEffect) { | 1274 void GrGLPerlinNoise::setData(const GrGLUniformManager& uman, const GrDrawEffect
& drawEffect) { |
1278 INHERITED::setData(uman, drawEffect); | 1275 INHERITED::setData(uman, drawEffect); |
1279 | 1276 |
1280 const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseE
ffect>(); | 1277 const GrPerlinNoiseEffect& turbulence = drawEffect.castEffect<GrPerlinNoiseE
ffect>(); |
1281 if (turbulence.stitchTiles()) { | 1278 if (turbulence.stitchTiles()) { |
1282 const SkPerlinNoiseShader::StitchData& stitchData = turbulence.stitchDat
a(); | 1279 const SkPerlinNoiseShader::StitchData& stitchData = turbulence.stitchDat
a(); |
1283 uman.set2f(fStitchDataUni, SkIntToScalar(stitchData.fWidth), | 1280 uman.set2f(fStitchDataUni, SkIntToScalar(stitchData.fWidth), |
1284 SkIntToScalar(stitchData.fHeight)); | 1281 SkIntToScalar(stitchData.fHeight)); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 str->append(" seed: "); | 1366 str->append(" seed: "); |
1370 str->appendScalar(fSeed); | 1367 str->appendScalar(fSeed); |
1371 str->append(" stitch tiles: "); | 1368 str->append(" stitch tiles: "); |
1372 str->append(fStitchTiles ? "true " : "false "); | 1369 str->append(fStitchTiles ? "true " : "false "); |
1373 | 1370 |
1374 this->INHERITED::toString(str); | 1371 this->INHERITED::toString(str); |
1375 | 1372 |
1376 str->append(")"); | 1373 str->append(")"); |
1377 } | 1374 } |
1378 #endif | 1375 #endif |
OLD | NEW |