diff options
author | 2012-10-24 19:07:10 +0000 | |
---|---|---|
committer | 2012-10-24 19:07:10 +0000 | |
commit | 6f261bed0252e3f3caa595798364e0bf12a2573a (patch) | |
tree | e6cf7cfab6ff785b002b88b165a6bd00a9402960 /src/effects | |
parent | a469c28c3c16214733a25201a286970f57b3d944 (diff) |
GrCustomStage Renaming Part 2
GrSamplerState member rename
GrCustomStageUnitTest rename
some comment updates
Review URL: https://codereview.appspot.com/6771043
git-svn-id: http://skia.googlecode.com/svn/trunk@6078 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkBlendImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkMatrixConvolutionImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkTableColorFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/gradients/SkLinearGradient.cpp | 10 | ||||
-rw-r--r-- | src/effects/gradients/SkRadialGradient.cpp | 10 | ||||
-rw-r--r-- | src/effects/gradients/SkSweepGradient.cpp | 10 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointConicalGradient.cpp | 8 | ||||
-rw-r--r-- | src/effects/gradients/SkTwoPointRadialGradient.cpp | 8 |
10 files changed, 33 insertions, 33 deletions
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index b658acc57a..fcda11454b 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -207,9 +207,9 @@ GrTexture* SkBlendImageFilter::onFilterImageGPU(Proxy* proxy, GrTexture* src, co backgroundTexMatrix.setIDiv(background->width(), background->height()); foregroundTexMatrix.setIDiv(foreground->width(), foreground->height()); GrPaint paint; - paint.colorSampler(0)->setCustomStage( + paint.colorSampler(0)->setEffect( SkNEW_ARGS(GrSingleTextureEffect, (background.get())), backgroundTexMatrix)->unref(); - paint.colorSampler(1)->setCustomStage( + paint.colorSampler(1)->setEffect( SkNEW_ARGS(GrBlendEffect, (fMode, foreground.get())), foregroundTexMatrix)->unref(); context->drawRect(paint, rect); return dst; diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 8e98415224..ab962fb2b7 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -1046,7 +1046,7 @@ GrEffect* GrDiffuseLightingEffect::TestCreate(SkRandom* random, SkScalar surfaceScale = random->nextSScalar1(); SkScalar kd = random->nextUScalar1(); SkAutoTUnref<SkLight> light(create_random_light(random)); - return SkNEW_ARGS(GrDiffuseLightingEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx], + return SkNEW_ARGS(GrDiffuseLightingEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx], light, surfaceScale, kd)); } @@ -1253,7 +1253,7 @@ GrEffect* GrSpecularLightingEffect::TestCreate(SkRandom* random, SkScalar ks = random->nextUScalar1(); SkScalar shininess = random->nextUScalar1(); SkAutoTUnref<SkLight> light(create_random_light(random)); - return SkNEW_ARGS(GrSpecularLightingEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx], + return SkNEW_ARGS(GrSpecularLightingEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx], light, surfaceScale, ks, shininess)); } diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index 3d26189029..2f6d71ca88 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -495,8 +495,8 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrMatrixConvolutionEffect); GrEffect* GrMatrixConvolutionEffect::TestCreate(SkRandom* random, GrContext* context, GrTexture* textures[]) { - int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx : - GrCustomStageUnitTest::kAlphaTextureIdx; + int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : + GrEffectUnitTest::kAlphaTextureIdx; int width = random->nextRangeU(1, MAX_KERNEL_SIZE); int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width); SkISize kernelSize = SkISize::Make(width, height); diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index dcd38b7b2f..fb82f4f4cf 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -403,8 +403,8 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrMorphologyEffect); GrEffect* GrMorphologyEffect::TestCreate(SkRandom* random, GrContext* context, GrTexture* textures[]) { - int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx : - GrCustomStageUnitTest::kAlphaTextureIdx; + int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : + GrEffectUnitTest::kAlphaTextureIdx; Direction dir = random->nextBool() ? kX_Direction : kY_Direction; static const int kMaxRadius = 10; int radius = random->nextRangeU(1, kMaxRadius); @@ -425,7 +425,7 @@ void apply_morphology_pass(GrContext* context, GrMatrix sampleM; sampleM.setIDiv(texture->width(), texture->height()); GrPaint paint; - paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)), sampleM)->unref(); + paint.colorSampler(0)->setEffect(SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)), sampleM)->unref(); context->drawRect(paint, rect); } diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index 71d56e28e7..cbbf7e1fc7 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -347,7 +347,7 @@ GR_DEFINE_CUSTOM_STAGE_TEST(ColorTableEffect); GrEffect* ColorTableEffect::TestCreate(SkRandom* random, GrContext* context, GrTexture* textures[]) { - return SkNEW_ARGS(ColorTableEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx])); + return SkNEW_ARGS(ColorTableEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx])); } GrEffect* SkTable_ColorFilter::asNewCustomStage(GrContext* context) const { diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 5b351d33d0..21b415d58b 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -540,10 +540,10 @@ GrEffect* GrLinearGradient::TestCreate(SkRandom* random, tm)); GrSamplerState sampler; shader->asNewCustomStage(context, &sampler); - GrAssert(NULL != sampler.getCustomStage()); + GrAssert(NULL != sampler.getEffect()); // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect* - sampler.getCustomStage()->ref(); - return const_cast<GrEffect*>(sampler.getCustomStage()); + sampler.getEffect()->ref(); + return const_cast<GrEffect*>(sampler.getEffect()); } ///////////////////////////////////////////////////////////////////// @@ -570,9 +570,9 @@ bool SkLinearGradient::asNewCustomStage(GrContext* context, GrSamplerState* samp return false; } matrix.postConcat(fPtsToUnit); - sampler->setCustomStage(stage, matrix); + sampler->setEffect(stage, matrix); } else { - sampler->setCustomStage(stage, fPtsToUnit); + sampler->setEffect(stage, fPtsToUnit); } return true; diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp index ca8325d91b..74d16d56cc 100644 --- a/src/effects/gradients/SkRadialGradient.cpp +++ b/src/effects/gradients/SkRadialGradient.cpp @@ -539,10 +539,10 @@ GrEffect* GrRadialGradient::TestCreate(SkRandom* random, tm)); GrSamplerState sampler; shader->asNewCustomStage(context, &sampler); - GrAssert(NULL != sampler.getCustomStage()); + GrAssert(NULL != sampler.getEffect()); // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect* - sampler.getCustomStage()->ref(); - return const_cast<GrEffect*>(sampler.getCustomStage()); + sampler.getEffect()->ref(); + return const_cast<GrEffect*>(sampler.getEffect()); } ///////////////////////////////////////////////////////////////////// @@ -568,9 +568,9 @@ bool SkRadialGradient::asNewCustomStage(GrContext* context, GrSamplerState* samp return false; } matrix.postConcat(fPtsToUnit); - sampler->setCustomStage(stage, matrix); + sampler->setEffect(stage, matrix); } else { - sampler->setCustomStage(stage, fPtsToUnit); + sampler->setEffect(stage, fPtsToUnit); } return true; diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp index 416babc622..365507b98f 100644 --- a/src/effects/gradients/SkSweepGradient.cpp +++ b/src/effects/gradients/SkSweepGradient.cpp @@ -445,10 +445,10 @@ GrEffect* GrSweepGradient::TestCreate(SkRandom* random, colors, stops, colorCount)); GrSamplerState sampler; shader->asNewCustomStage(context, &sampler); - GrAssert(NULL != sampler.getCustomStage()); + GrAssert(NULL != sampler.getEffect()); // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect* - sampler.getCustomStage()->ref(); - return const_cast<GrEffect*>(sampler.getCustomStage()); + sampler.getEffect()->ref(); + return const_cast<GrEffect*>(sampler.getEffect()); } ///////////////////////////////////////////////////////////////////// @@ -475,9 +475,9 @@ bool SkSweepGradient::asNewCustomStage(GrContext* context, GrSamplerState* sampl return false; } matrix.postConcat(fPtsToUnit); - sampler->setCustomStage(stage, matrix); + sampler->setEffect(stage, matrix); } else { - sampler->setCustomStage(stage, fPtsToUnit); + sampler->setEffect(stage, fPtsToUnit); } return true; diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp index 1b0f58f7b0..4472d03d9f 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp @@ -439,10 +439,10 @@ GrEffect* GrConical2Gradient::TestCreate(SkRandom* random, tm)); GrSamplerState sampler; shader->asNewCustomStage(context, &sampler); - GrAssert(NULL != sampler.getCustomStage()); + GrAssert(NULL != sampler.getEffect()); // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect* - sampler.getCustomStage()->ref(); - return const_cast<GrEffect*>(sampler.getCustomStage()); + sampler.getEffect()->ref(); + return const_cast<GrEffect*>(sampler.getEffect()); } @@ -693,7 +693,7 @@ bool SkTwoPointConicalGradient::asNewCustomStage(GrContext* context, matrix.preConcat(localM); } - sampler->setCustomStage(SkNEW_ARGS(GrConical2Gradient, (context, *this, fTileMode)), matrix)->unref(); + sampler->setEffect(SkNEW_ARGS(GrConical2Gradient, (context, *this, fTileMode)), matrix)->unref(); return true; } diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp index 50938f6fe7..78220f8d2a 100644 --- a/src/effects/gradients/SkTwoPointRadialGradient.cpp +++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp @@ -473,10 +473,10 @@ GrEffect* GrRadial2Gradient::TestCreate(SkRandom* random, tm)); GrSamplerState sampler; shader->asNewCustomStage(context, &sampler); - GrAssert(NULL != sampler.getCustomStage()); + GrAssert(NULL != sampler.getEffect()); // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect* - sampler.getCustomStage()->ref(); - return const_cast<GrEffect*>(sampler.getCustomStage()); + sampler.getEffect()->ref(); + return const_cast<GrEffect*>(sampler.getEffect()); } ///////////////////////////////////////////////////////////////////// @@ -665,7 +665,7 @@ bool SkTwoPointRadialGradient::asNewCustomStage(GrContext* context, matrix.preConcat(localM); } - sampler->setCustomStage(SkNEW_ARGS(GrRadial2Gradient, (context, *this, fTileMode)), matrix)->unref(); + sampler->setEffect(SkNEW_ARGS(GrRadial2Gradient, (context, *this, fTileMode)), matrix)->unref(); return true; } |