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

Side by Side Diff: experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months 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 | « no previous file | gm/texdata.cpp » ('j') | include/gpu/GrTextureAccess.h » ('J')
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 "SkPerlinNoiseShader2.h" 9 #include "SkPerlinNoiseShader2.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 } 676 }
677 677
678 GrPerlinNoise2Effect(SkPerlinNoiseShader2::Type type, 678 GrPerlinNoise2Effect(SkPerlinNoiseShader2::Type type,
679 int numOctaves, bool stitchTiles, 679 int numOctaves, bool stitchTiles,
680 SkPerlinNoiseShader2::PaintingData* paintingData, 680 SkPerlinNoiseShader2::PaintingData* paintingData,
681 GrTexture* permutationsTexture, GrTexture* noiseTexture, 681 GrTexture* permutationsTexture, GrTexture* noiseTexture,
682 const SkMatrix& matrix) 682 const SkMatrix& matrix)
683 : fType(type) 683 : fType(type)
684 , fNumOctaves(numOctaves) 684 , fNumOctaves(numOctaves)
685 , fStitchTiles(stitchTiles) 685 , fStitchTiles(stitchTiles)
686 , fPermutationsAccess(permutationsTexture) 686 , fPermutationsAccess(permutationsTexture, nullptr)
687 , fNoiseAccess(noiseTexture) 687 , fNoiseAccess(noiseTexture, nullptr)
688 , fPaintingData(paintingData) { 688 , fPaintingData(paintingData) {
689 this->initClassID<GrPerlinNoise2Effect>(); 689 this->initClassID<GrPerlinNoise2Effect>();
690 this->addTextureAccess(&fPermutationsAccess); 690 this->addTextureAccess(&fPermutationsAccess);
691 this->addTextureAccess(&fNoiseAccess); 691 this->addTextureAccess(&fNoiseAccess);
692 fCoordTransform.reset(kLocal_GrCoordSet, matrix); 692 fCoordTransform.reset(kLocal_GrCoordSet, matrix);
693 this->addCoordTransform(&fCoordTransform); 693 this->addCoordTransform(&fCoordTransform);
694 } 694 }
695 695
696 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 696 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
697 697
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { 1088 void onComputeInvariantOutput(GrInvariantOutput* inout) const override {
1089 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); 1089 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput);
1090 } 1090 }
1091 1091
1092 GrImprovedPerlinNoiseEffect(int octaves, SkScalar z, 1092 GrImprovedPerlinNoiseEffect(int octaves, SkScalar z,
1093 SkPerlinNoiseShader2::PaintingData* paintingData , 1093 SkPerlinNoiseShader2::PaintingData* paintingData ,
1094 GrTexture* permutationsTexture, GrTexture* gradi entTexture, 1094 GrTexture* permutationsTexture, GrTexture* gradi entTexture,
1095 const SkMatrix& matrix) 1095 const SkMatrix& matrix)
1096 : fOctaves(octaves) 1096 : fOctaves(octaves)
1097 , fZ(z) 1097 , fZ(z)
1098 , fPermutationsAccess(permutationsTexture) 1098 , fPermutationsAccess(permutationsTexture, nullptr)
1099 , fGradientAccess(gradientTexture) 1099 , fGradientAccess(gradientTexture, nullptr)
1100 , fPaintingData(paintingData) { 1100 , fPaintingData(paintingData) {
1101 this->initClassID<GrImprovedPerlinNoiseEffect>(); 1101 this->initClassID<GrImprovedPerlinNoiseEffect>();
1102 this->addTextureAccess(&fPermutationsAccess); 1102 this->addTextureAccess(&fPermutationsAccess);
1103 this->addTextureAccess(&fGradientAccess); 1103 this->addTextureAccess(&fGradientAccess);
1104 fCoordTransform.reset(kLocal_GrCoordSet, matrix); 1104 fCoordTransform.reset(kLocal_GrCoordSet, matrix);
1105 this->addCoordTransform(&fCoordTransform); 1105 this->addCoordTransform(&fCoordTransform);
1106 } 1106 }
1107 1107
1108 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 1108 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
1109 1109
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 str->append(" seed: "); 1400 str->append(" seed: ");
1401 str->appendScalar(fSeed); 1401 str->appendScalar(fSeed);
1402 str->append(" stitch tiles: "); 1402 str->append(" stitch tiles: ");
1403 str->append(fStitchTiles ? "true " : "false "); 1403 str->append(fStitchTiles ? "true " : "false ");
1404 1404
1405 this->INHERITED::toString(str); 1405 this->INHERITED::toString(str);
1406 1406
1407 str->append(")"); 1407 str->append(")");
1408 } 1408 }
1409 #endif 1409 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/texdata.cpp » ('j') | include/gpu/GrTextureAccess.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698