| Index: src/effects/SkMorphologyImageFilter.cpp
|
| diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
|
| index 630f782f90b59ca35f05e88b5b22b3e258a14459..87373c0bc267c1a24164e9d3d695b3231daed130 100644
|
| --- a/src/effects/SkMorphologyImageFilter.cpp
|
| +++ b/src/effects/SkMorphologyImageFilter.cpp
|
| @@ -21,6 +21,7 @@
|
| #include "GrFixedClip.h"
|
| #include "GrInvariantOutput.h"
|
| #include "GrTexture.h"
|
| +#include "GrTextureProxy.h"
|
| #include "SkGr.h"
|
| #include "SkGrPriv.h"
|
| #include "effects/Gr1DKernelEffect.h"
|
| @@ -155,6 +156,16 @@ public:
|
| return sk_sp<GrFragmentProcessor>(new GrMorphologyEffect(tex, dir, radius, type, bounds));
|
| }
|
|
|
| + static sk_sp<GrFragmentProcessor> Make(GrTextureProxy* tex, Direction dir, int radius,
|
| + MorphologyType type) {
|
| + return sk_sp<GrFragmentProcessor>(new GrMorphologyEffect(tex, dir, radius, type));
|
| + }
|
| +
|
| + static sk_sp<GrFragmentProcessor> Make(GrTextureProxy* tex, Direction dir, int radius,
|
| + MorphologyType type, float bounds[2]) {
|
| + return sk_sp<GrFragmentProcessor>(new GrMorphologyEffect(tex, dir, radius, type, bounds));
|
| + }
|
| +
|
| virtual ~GrMorphologyEffect();
|
|
|
| MorphologyType type() const { return fType; }
|
| @@ -179,8 +190,10 @@ private:
|
| void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
|
|
|
| GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType);
|
| - GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType,
|
| - float bounds[2]);
|
| + GrMorphologyEffect(GrTexture*, Direction, int radius, MorphologyType, float bounds[2]);
|
| +
|
| + GrMorphologyEffect(GrTextureProxy*, Direction, int radius, MorphologyType);
|
| + GrMorphologyEffect(GrTextureProxy*, Direction, int radius, MorphologyType, float bounds[2]);
|
|
|
| GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
|
|
|
| @@ -387,7 +400,7 @@ sk_sp<GrFragmentProcessor> GrMorphologyEffect::TestCreate(GrProcessorTestData* d
|
|
|
| static void apply_morphology_rect(GrRenderTargetContext* renderTargetContext,
|
| const GrClip& clip,
|
| - GrTexture* texture,
|
| + GrTextureProxy* texture,
|
| const SkIRect& srcRect,
|
| const SkIRect& dstRect,
|
| int radius,
|
| @@ -408,7 +421,7 @@ static void apply_morphology_rect(GrRenderTargetContext* renderTargetContext,
|
|
|
| static void apply_morphology_rect_no_bounds(GrRenderTargetContext* renderTargetContext,
|
| const GrClip& clip,
|
| - GrTexture* texture,
|
| + GrTextureProxy* texture,
|
| const SkIRect& srcRect,
|
| const SkIRect& dstRect,
|
| int radius,
|
| @@ -425,7 +438,7 @@ static void apply_morphology_rect_no_bounds(GrRenderTargetContext* renderTargetC
|
|
|
| static void apply_morphology_pass(GrRenderTargetContext* renderTargetContext,
|
| const GrClip& clip,
|
| - GrTexture* texture,
|
| + GrTextureProxy* texture,
|
| const SkIRect& srcRect,
|
| const SkIRect& dstRect,
|
| int radius,
|
| @@ -476,7 +489,7 @@ static sk_sp<SkSpecialImage> apply_morphology(
|
| GrMorphologyEffect::MorphologyType morphType,
|
| SkISize radius,
|
| const SkImageFilter::OutputProperties& outputProperties) {
|
| - sk_sp<GrTexture> srcTexture(input->asTextureRef(context));
|
| + sk_sp<GrTextureProxy> srcTexture(input->asTextureProxy(context));
|
| SkASSERT(srcTexture);
|
| sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace());
|
| GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get());
|
| @@ -506,7 +519,7 @@ static sk_sp<SkSpecialImage> apply_morphology(
|
| : SK_ColorTRANSPARENT;
|
| dstRenderTargetContext->clear(&clearRect, clearColor, false);
|
|
|
| - srcTexture = dstRenderTargetContext->asTexture();
|
| + srcTexture = dstRenderTargetContext->asDeferredTexture();
|
| srcRect = dstRect;
|
| }
|
| if (radius.fHeight > 0) {
|
| @@ -520,13 +533,13 @@ static sk_sp<SkSpecialImage> apply_morphology(
|
| srcRect, dstRect, radius.fHeight, morphType,
|
| Gr1DKernelEffect::kY_Direction);
|
|
|
| - srcTexture = dstRenderTargetContext->asTexture();
|
| + srcTexture = dstRenderTargetContext->asDeferredTexture();
|
| }
|
|
|
| - return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(rect.width(), rect.height()),
|
| - kNeedNewImageUniqueID_SpecialImage,
|
| - std::move(srcTexture), std::move(colorSpace),
|
| - &input->props());
|
| + return SkSpecialImage::MakeDeferredFromGpu(SkIRect::MakeWH(rect.width(), rect.height()),
|
| + kNeedNewImageUniqueID_SpecialImage,
|
| + std::move(srcTexture), std::move(colorSpace),
|
| + &input->props());
|
| }
|
| #endif
|
|
|
|
|