Start plumbing deferral of GPU resources in the image filters
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4688
Change-Id: I904d999ea87a55bee73765aa96a2f8aef7a0d61c
Reviewed-on: https://skia-review.googlesource.com/4688
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index d73b440..8cb610e 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -15,9 +15,11 @@
#include "SkColorPriv.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
-#include "GrRenderTargetContext.h"
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
+#include "GrRenderTargetContext.h"
+#include "GrTextureProxy.h"
+
#include "SkGr.h"
#include "SkGrPriv.h"
#include "effects/GrTextureDomain.h"
@@ -349,9 +351,10 @@
SkColorSpace* colorSpace = ctx.outputProperties().colorSpace();
sk_sp<GrRenderTargetContext> renderTargetContext(
- context->makeRenderTargetContext(SkBackingFit::kApprox, bounds.width(), bounds.height(),
- GrRenderableConfigForColorSpace(colorSpace),
- sk_ref_sp(colorSpace)));
+ context->makeDeferredRenderTargetContext(SkBackingFit::kApprox,
+ bounds.width(), bounds.height(),
+ GrRenderableConfigForColorSpace(colorSpace),
+ sk_ref_sp(colorSpace)));
if (!renderTargetContext) {
return nullptr;
}
@@ -361,10 +364,12 @@
offset->fX = bounds.left();
offset->fY = bounds.top();
- return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
- kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->asTexture(),
- sk_ref_sp(renderTargetContext->getColorSpace()));
+ return SkSpecialImage::MakeDeferredFromGpu(
+ context,
+ SkIRect::MakeWH(bounds.width(), bounds.height()),
+ kNeedNewImageUniqueID_SpecialImage,
+ sk_ref_sp(renderTargetContext->asDeferredTexture()),
+ sk_ref_sp(renderTargetContext->getColorSpace()));
}
#endif