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

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 1213623022: fix up test create functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 932a4b1e3a58d77e8b7775e5c14946b112f630c0..817206ffa9e9c50b8bc8e441200ecfcb837c5d68 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -527,31 +527,27 @@ void GrDisplacementMapEffect::onComputeInvariantOutput(GrInvariantOutput* inout)
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect);
-GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrCaps&,
- GrTexture* textures[]) {
- int texIdxDispl = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
- int texIdxColor = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
+GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(GrProcessorTestData* d) {
+ int texIdxDispl = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+ GrProcessorUnitTest::kAlphaTextureIdx;
+ int texIdxColor = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
+ GrProcessorUnitTest::kAlphaTextureIdx;
static const int kMaxComponent = 4;
SkDisplacementMapEffect::ChannelSelectorType xChannelSelector =
static_cast<SkDisplacementMapEffect::ChannelSelectorType>(
- random->nextRangeU(1, kMaxComponent));
+ d->fRandom->nextRangeU(1, kMaxComponent));
SkDisplacementMapEffect::ChannelSelectorType yChannelSelector =
static_cast<SkDisplacementMapEffect::ChannelSelectorType>(
- random->nextRangeU(1, kMaxComponent));
- SkVector scale = SkVector::Make(random->nextRangeScalar(0, 100.0f),
- random->nextRangeScalar(0, 100.0f));
+ d->fRandom->nextRangeU(1, kMaxComponent));
+ SkVector scale = SkVector::Make(d->fRandom->nextRangeScalar(0, 100.0f),
+ d->fRandom->nextRangeScalar(0, 100.0f));
SkISize colorDimensions;
- colorDimensions.fWidth = random->nextRangeU(0, textures[texIdxColor]->width());
- colorDimensions.fHeight = random->nextRangeU(0, textures[texIdxColor]->height());
- GrShaderDataManager shaderDataManager;
- return GrDisplacementMapEffect::Create(&shaderDataManager,
+ colorDimensions.fWidth = d->fRandom->nextRangeU(0, d->fTextures[texIdxColor]->width());
+ colorDimensions.fHeight = d->fRandom->nextRangeU(0, d->fTextures[texIdxColor]->height());
+ return GrDisplacementMapEffect::Create(d->fShaderDataManager,
xChannelSelector, yChannelSelector, scale,
- textures[texIdxDispl], SkMatrix::I(),
- textures[texIdxColor], colorDimensions);
+ d->fTextures[texIdxDispl], SkMatrix::I(),
+ d->fTextures[texIdxColor], colorDimensions);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698