aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkMorphologyImageFilter.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-07-09 10:24:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-09 10:24:36 -0700
commit5f10b5c1b5744106312e24835d235b72fdba5802 (patch)
tree84b17f420f40ff9793f7d24285fa81412102bae7 /src/effects/SkMorphologyImageFilter.cpp
parentcc29d26f5742449eb2a2bafa7bbb6ec5ee701aef (diff)
More threading of GrProcessorDataManager
TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1230813003
Diffstat (limited to 'src/effects/SkMorphologyImageFilter.cpp')
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index f284360b03..62b90cb32d 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -298,14 +298,15 @@ public:
kDilate_MorphologyType,
};
- static GrFragmentProcessor* Create(GrTexture* tex, Direction dir, int radius,
- MorphologyType type) {
- return SkNEW_ARGS(GrMorphologyEffect, (tex, dir, radius, type));
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
+ Direction dir, int radius, MorphologyType type) {
+ return SkNEW_ARGS(GrMorphologyEffect, (procDataManager, tex, dir, radius, type));
}
- static GrFragmentProcessor* Create(GrTexture* tex, Direction dir, int radius,
- MorphologyType type, float bounds[2]) {
- return SkNEW_ARGS(GrMorphologyEffect, (tex, dir, radius, type, bounds));
+ static GrFragmentProcessor* Create(GrProcessorDataManager* procDataManager, GrTexture* tex,
+ Direction dir, int radius, MorphologyType type,
+ float bounds[2]) {
+ return SkNEW_ARGS(GrMorphologyEffect, (procDataManager, tex, dir, radius, type, bounds));
}
virtual ~GrMorphologyEffect();
@@ -331,8 +332,9 @@ private:
void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
- GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType);
- GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType, float bounds[2]);
+ GrMorphologyEffect(GrProcessorDataManager*, GrTexture*, Direction, int radius, MorphologyType);
+ GrMorphologyEffect(GrProcessorDataManager*, GrTexture*, Direction, int radius, MorphologyType,
+ float bounds[2]);
GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
@@ -494,21 +496,23 @@ void GrGLMorphologyEffect::setData(const GrGLProgramDataManager& pdman,
///////////////////////////////////////////////////////////////////////////////
-GrMorphologyEffect::GrMorphologyEffect(GrTexture* texture,
+GrMorphologyEffect::GrMorphologyEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
Direction direction,
int radius,
MorphologyType type)
- : Gr1DKernelEffect(texture, direction, radius)
+ : INHERITED(procDataManager, texture, direction, radius)
, fType(type), fUseRange(false) {
this->initClassID<GrMorphologyEffect>();
}
-GrMorphologyEffect::GrMorphologyEffect(GrTexture* texture,
+GrMorphologyEffect::GrMorphologyEffect(GrProcessorDataManager* procDataManager,
+ GrTexture* texture,
Direction direction,
int radius,
MorphologyType type,
float range[2])
- : Gr1DKernelEffect(texture, direction, radius)
+ : INHERITED(procDataManager, texture, direction, radius)
, fType(type), fUseRange(true) {
this->initClassID<GrMorphologyEffect>();
fRange[0] = range[0];
@@ -552,7 +556,7 @@ GrFragmentProcessor* GrMorphologyEffect::TestCreate(GrProcessorTestData* d) {
MorphologyType type = d->fRandom->nextBool() ? GrMorphologyEffect::kErode_MorphologyType :
GrMorphologyEffect::kDilate_MorphologyType;
- return GrMorphologyEffect::Create(d->fTextures[texIdx], dir, radius, type);
+ return GrMorphologyEffect::Create(d->fProcDataManager, d->fTextures[texIdx], dir, radius, type);
}
namespace {
@@ -569,7 +573,8 @@ void apply_morphology_rect(GrDrawContext* drawContext,
float bounds[2],
Gr1DKernelEffect::Direction direction) {
GrPaint paint;
- paint.addColorProcessor(GrMorphologyEffect::Create(texture,
+ paint.addColorProcessor(GrMorphologyEffect::Create(paint.getProcessorDataManager(),
+ texture,
direction,
radius,
morphType,
@@ -588,7 +593,8 @@ void apply_morphology_rect_no_bounds(GrDrawContext* drawContext,
GrMorphologyEffect::MorphologyType morphType,
Gr1DKernelEffect::Direction direction) {
GrPaint paint;
- paint.addColorProcessor(GrMorphologyEffect::Create(texture,
+ paint.addColorProcessor(GrMorphologyEffect::Create(paint.getProcessorDataManager(),
+ texture,
direction,
radius,
morphType))->unref();