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

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

Issue 1684063006: Add GrShaderFlags enum (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Bit->Flag Created 4 years, 10 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 | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkPixelXorXfermode.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 "SkPerlinNoiseShader.h" 8 #include "SkPerlinNoiseShader.h"
9 #include "SkColorFilter.h" 9 #include "SkColorFilter.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 kNone_SkFilterQuality); 591 kNone_SkFilterQuality);
592 } 592 }
593 593
594 void GrGLPerlinNoise::emitCode(EmitArgs& args) { 594 void GrGLPerlinNoise::emitCode(EmitArgs& args) {
595 const GrPerlinNoiseEffect& pne = args.fFp.cast<GrPerlinNoiseEffect>(); 595 const GrPerlinNoiseEffect& pne = args.fFp.cast<GrPerlinNoiseEffect>();
596 596
597 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 597 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
598 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 598 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
599 SkString vCoords = fragBuilder->ensureFSCoords2D(args.fCoords, 0); 599 SkString vCoords = fragBuilder->ensureFSCoords2D(args.fCoords, 0);
600 600
601 fBaseFrequencyUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragme nt_Visibility, 601 fBaseFrequencyUni = uniformHandler->addUniform(kFragment_GrShaderFlag,
602 kVec2f_GrSLType, kDefault_GrS LPrecision, 602 kVec2f_GrSLType, kDefault_GrS LPrecision,
603 "baseFrequency"); 603 "baseFrequency");
604 const char* baseFrequencyUni = uniformHandler->getUniformCStr(fBaseFrequency Uni); 604 const char* baseFrequencyUni = uniformHandler->getUniformCStr(fBaseFrequency Uni);
605 605
606 const char* stitchDataUni = nullptr; 606 const char* stitchDataUni = nullptr;
607 if (pne.stitchTiles()) { 607 if (pne.stitchTiles()) {
608 fStitchDataUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragm ent_Visibility, 608 fStitchDataUni = uniformHandler->addUniform(kFragment_GrShaderFlag,
609 kVec2f_GrSLType, kDefault_Gr SLPrecision, 609 kVec2f_GrSLType, kDefault_Gr SLPrecision,
610 "stitchData"); 610 "stitchData");
611 stitchDataUni = uniformHandler->getUniformCStr(fStitchDataUni); 611 stitchDataUni = uniformHandler->getUniformCStr(fStitchDataUni);
612 } 612 }
613 613
614 // There are 4 lines, so the center of each line is 1/8, 3/8, 5/8 and 7/8 614 // There are 4 lines, so the center of each line is 1/8, 3/8, 5/8 and 7/8
615 const char* chanCoordR = "0.125"; 615 const char* chanCoordR = "0.125";
616 const char* chanCoordG = "0.375"; 616 const char* chanCoordG = "0.375";
617 const char* chanCoordB = "0.625"; 617 const char* chanCoordB = "0.625";
618 const char* chanCoordA = "0.875"; 618 const char* chanCoordA = "0.875";
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 str->append(" seed: "); 970 str->append(" seed: ");
971 str->appendScalar(fSeed); 971 str->appendScalar(fSeed);
972 str->append(" stitch tiles: "); 972 str->append(" stitch tiles: ");
973 str->append(fStitchTiles ? "true " : "false "); 973 str->append(fStitchTiles ? "true " : "false ");
974 974
975 this->INHERITED::toString(str); 975 this->INHERITED::toString(str);
976 976
977 str->append(")"); 977 str->append(")");
978 } 978 }
979 #endif 979 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkPixelXorXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698