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 "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 527 |
528 const SkPerlinNoiseShader::StitchData& stitchData() const { return fPainting
Data->fStitchDataInit; } | 528 const SkPerlinNoiseShader::StitchData& stitchData() const { return fPainting
Data->fStitchDataInit; } |
529 | 529 |
530 SkPerlinNoiseShader::Type type() const { return fType; } | 530 SkPerlinNoiseShader::Type type() const { return fType; } |
531 bool stitchTiles() const { return fStitchTiles; } | 531 bool stitchTiles() const { return fStitchTiles; } |
532 const SkVector& baseFrequency() const { return fPaintingData->fBaseFrequency
; } | 532 const SkVector& baseFrequency() const { return fPaintingData->fBaseFrequency
; } |
533 int numOctaves() const { return fNumOctaves; } | 533 int numOctaves() const { return fNumOctaves; } |
534 const SkMatrix& matrix() const { return fCoordTransform.getMatrix(); } | 534 const SkMatrix& matrix() const { return fCoordTransform.getMatrix(); } |
535 | 535 |
536 private: | 536 private: |
537 GrGLSLFragmentProcessor* onCreateGLInstance() const override { | 537 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { |
538 return new GrGLPerlinNoise(*this); | 538 return new GrGLPerlinNoise(*this); |
539 } | 539 } |
540 | 540 |
541 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, | 541 virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
542 GrProcessorKeyBuilder* b) const override { | 542 GrProcessorKeyBuilder* b) const override
{ |
543 GrGLPerlinNoise::GenKey(*this, caps, b); | 543 GrGLPerlinNoise::GenKey(*this, caps, b); |
544 } | 544 } |
545 | 545 |
546 bool onIsEqual(const GrFragmentProcessor& sBase) const override { | 546 bool onIsEqual(const GrFragmentProcessor& sBase) const override { |
547 const GrPerlinNoiseEffect& s = sBase.cast<GrPerlinNoiseEffect>(); | 547 const GrPerlinNoiseEffect& s = sBase.cast<GrPerlinNoiseEffect>(); |
548 return fType == s.fType && | 548 return fType == s.fType && |
549 fPaintingData->fBaseFrequency == s.fPaintingData->fBaseFrequency
&& | 549 fPaintingData->fBaseFrequency == s.fPaintingData->fBaseFrequency
&& |
550 fNumOctaves == s.fNumOctaves && | 550 fNumOctaves == s.fNumOctaves && |
551 fStitchTiles == s.fStitchTiles && | 551 fStitchTiles == s.fStitchTiles && |
552 fPaintingData->fStitchDataInit == s.fPaintingData->fStitchDataIni
t; | 552 fPaintingData->fStitchDataInit == s.fPaintingData->fStitchDataIni
t; |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 str->append(" seed: "); | 996 str->append(" seed: "); |
997 str->appendScalar(fSeed); | 997 str->appendScalar(fSeed); |
998 str->append(" stitch tiles: "); | 998 str->append(" stitch tiles: "); |
999 str->append(fStitchTiles ? "true " : "false "); | 999 str->append(fStitchTiles ? "true " : "false "); |
1000 | 1000 |
1001 this->INHERITED::toString(str); | 1001 this->INHERITED::toString(str); |
1002 | 1002 |
1003 str->append(")"); | 1003 str->append(")"); |
1004 } | 1004 } |
1005 #endif | 1005 #endif |
OLD | NEW |