Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 755363002: remove proc key (Closed) Base URL: https://skia.googlesource.com/skia.git@fixkey
Patch Set: address nit Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 #include "GrTBackendProcessorFactory.h" 511 #include "GrTBackendProcessorFactory.h"
512 512
513 class GrGLPerlinNoise : public GrGLFragmentProcessor { 513 class GrGLPerlinNoise : public GrGLFragmentProcessor {
514 public: 514 public:
515 GrGLPerlinNoise(const GrBackendProcessorFactory&, 515 GrGLPerlinNoise(const GrBackendProcessorFactory&,
516 const GrProcessor&); 516 const GrProcessor&);
517 virtual ~GrGLPerlinNoise() {} 517 virtual ~GrGLPerlinNoise() {}
518 518
519 virtual void emitCode(GrGLFPBuilder*, 519 virtual void emitCode(GrGLFPBuilder*,
520 const GrFragmentProcessor&, 520 const GrFragmentProcessor&,
521 const GrProcessorKey&,
522 const char* outputColor, 521 const char* outputColor,
523 const char* inputColor, 522 const char* inputColor,
524 const TransformedCoordsArray&, 523 const TransformedCoordsArray&,
525 const TextureSamplerArray&) SK_OVERRIDE; 524 const TextureSamplerArray&) SK_OVERRIDE;
526 525
527 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O VERRIDE; 526 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O VERRIDE;
528 527
529 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKe yBuilder* b); 528 static inline void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKe yBuilder* b);
530 529
531 private: 530 private:
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 GrGLPerlinNoise::GrGLPerlinNoise(const GrBackendProcessorFactory& factory, 655 GrGLPerlinNoise::GrGLPerlinNoise(const GrBackendProcessorFactory& factory,
657 const GrProcessor& processor) 656 const GrProcessor& processor)
658 : INHERITED (factory) 657 : INHERITED (factory)
659 , fType(processor.cast<GrPerlinNoiseEffect>().type()) 658 , fType(processor.cast<GrPerlinNoiseEffect>().type())
660 , fStitchTiles(processor.cast<GrPerlinNoiseEffect>().stitchTiles()) 659 , fStitchTiles(processor.cast<GrPerlinNoiseEffect>().stitchTiles())
661 , fNumOctaves(processor.cast<GrPerlinNoiseEffect>().numOctaves()) { 660 , fNumOctaves(processor.cast<GrPerlinNoiseEffect>().numOctaves()) {
662 } 661 }
663 662
664 void GrGLPerlinNoise::emitCode(GrGLFPBuilder* builder, 663 void GrGLPerlinNoise::emitCode(GrGLFPBuilder* builder,
665 const GrFragmentProcessor&, 664 const GrFragmentProcessor&,
666 const GrProcessorKey& key,
667 const char* outputColor, 665 const char* outputColor,
668 const char* inputColor, 666 const char* inputColor,
669 const TransformedCoordsArray& coords, 667 const TransformedCoordsArray& coords,
670 const TextureSamplerArray& samplers) { 668 const TextureSamplerArray& samplers) {
671 sk_ignore_unused_variable(inputColor); 669 sk_ignore_unused_variable(inputColor);
672 670
673 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 671 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
674 SkString vCoords = fsBuilder->ensureFSCoords2D(coords, 0); 672 SkString vCoords = fsBuilder->ensureFSCoords2D(coords, 0);
675 673
676 fBaseFrequencyUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibi lity, 674 fBaseFrequencyUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibi lity,
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 str->append(" seed: "); 1048 str->append(" seed: ");
1051 str->appendScalar(fSeed); 1049 str->appendScalar(fSeed);
1052 str->append(" stitch tiles: "); 1050 str->append(" stitch tiles: ");
1053 str->append(fStitchTiles ? "true " : "false "); 1051 str->append(fStitchTiles ? "true " : "false ");
1054 1052
1055 this->INHERITED::toString(str); 1053 this->INHERITED::toString(str);
1056 1054
1057 str->append(")"); 1055 str->append(")");
1058 } 1056 }
1059 #endif 1057 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698