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

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

Issue 1117443002: create GrTestUtils.h, move some common functions into it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « include/gpu/GrTestUtils.h ('k') | src/effects/gradients/SkLinearGradient.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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 SkShader* shader = random->nextBool() ? 618 SkShader* shader = random->nextBool() ?
619 SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves, seed, 619 SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves, seed,
620 stitchTiles ? &tileSize : NULL) : 620 stitchTiles ? &tileSize : NULL) :
621 SkPerlinNoiseShader::CreateTurbulence(baseFrequencyX, baseFrequencyY, nu mOctaves, seed, 621 SkPerlinNoiseShader::CreateTurbulence(baseFrequencyX, baseFrequencyY, nu mOctaves, seed,
622 stitchTiles ? &tileSize : NULL); 622 stitchTiles ? &tileSize : NULL);
623 623
624 SkPaint paint; 624 SkPaint paint;
625 GrColor paintColor; 625 GrColor paintColor;
626 GrFragmentProcessor* effect; 626 GrFragmentProcessor* effect;
627 SkAssertResult(shader->asFragmentProcessor(context, paint, 627 SkAssertResult(shader->asFragmentProcessor(context, paint,
628 GrProcessorUnitTest::TestMatrix(r andom), NULL, 628 GrTest::TestMatrix(random), NULL,
629 &paintColor, &effect)); 629 &paintColor, &effect));
630 630
631 SkDELETE(shader); 631 SkDELETE(shader);
632 632
633 return effect; 633 return effect;
634 } 634 }
635 635
636 GrGLPerlinNoise::GrGLPerlinNoise(const GrProcessor& processor) 636 GrGLPerlinNoise::GrGLPerlinNoise(const GrProcessor& processor)
637 : fType(processor.cast<GrPerlinNoiseEffect>().type()) 637 : fType(processor.cast<GrPerlinNoiseEffect>().type())
638 , fStitchTiles(processor.cast<GrPerlinNoiseEffect>().stitchTiles()) 638 , fStitchTiles(processor.cast<GrPerlinNoiseEffect>().stitchTiles())
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 str->append(" seed: "); 1032 str->append(" seed: ");
1033 str->appendScalar(fSeed); 1033 str->appendScalar(fSeed);
1034 str->append(" stitch tiles: "); 1034 str->append(" stitch tiles: ");
1035 str->append(fStitchTiles ? "true " : "false "); 1035 str->append(fStitchTiles ? "true " : "false ");
1036 1036
1037 this->INHERITED::toString(str); 1037 this->INHERITED::toString(str);
1038 1038
1039 str->append(")"); 1039 str->append(")");
1040 } 1040 }
1041 #endif 1041 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTestUtils.h ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698