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

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month 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/SkBlurMaskFilter.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 d73b440a7519f3d463d0b705e86918d1b72287e5..71fd9c00c43be7415644e45d9b082b36cce19b41 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -18,6 +18,7 @@
#include "GrRenderTargetContext.h"
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
+#include "GrTextureProxy.h"
#include "SkGr.h"
#include "SkGrPriv.h"
#include "effects/GrTextureDomain.h"
@@ -349,7 +350,7 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
SkColorSpace* colorSpace = ctx.outputProperties().colorSpace();
sk_sp<GrRenderTargetContext> renderTargetContext(
- context->makeRenderTargetContext(SkBackingFit::kApprox, bounds.width(), bounds.height(),
+ context->makeDeferredRenderTargetContext(SkBackingFit::kApprox, bounds.width(), bounds.height(),
GrRenderableConfigForColorSpace(colorSpace),
sk_ref_sp(colorSpace)));
if (!renderTargetContext) {
@@ -361,10 +362,10 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
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(SkIRect::MakeWH(bounds.width(), bounds.height()),
+ kNeedNewImageUniqueID_SpecialImage,
+ renderTargetContext->asDeferredTexture(),
+ sk_ref_sp(renderTargetContext->getColorSpace()));
}
#endif
@@ -483,7 +484,8 @@ GrDisplacementMapEffect::GrDisplacementMapEffect(
: fDisplacementTransform(offsetMatrix, displacement, GrTextureParams::kNone_FilterMode)
, fDisplacementAccess(displacement)
, fColorTransform(color, GrTextureParams::kNone_FilterMode)
- , fDomain(GrTextureDomain::MakeTexelDomain(color, SkIRect::MakeSize(colorDimensions)),
+ , fDomain(GrTextureDomain::MakeTexelDomain(color->width(), color->height(),
+ SkIRect::MakeSize(colorDimensions)),
GrTextureDomain::kDecal_Mode)
, fColorAccess(color)
, fXChannelSelector(xChannelSelector)
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698