Smaller fragment from "Reduce dependence on GrSurface's origin field"
TBR=bsalomon@google.com
Change-Id: I996226ffaf84ca357740a6da9bb80a3b8febb379
Reviewed-on: https://skia-review.googlesource.com/25745
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 90756a7..06e7e68 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -597,14 +597,15 @@
void GrGLDisplacementMapEffect::onSetData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& proc) {
const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMapEffect>();
- GrTexture* colorTex = displacementMap.textureSampler(1).peekTexture();
+ GrSurfaceProxy* proxy = displacementMap.textureSampler(1).proxy();
+ GrTexture* colorTex = proxy->priv().peekTexture();
SkScalar scaleX = displacementMap.scale().fX / colorTex->width();
SkScalar scaleY = displacementMap.scale().fY / colorTex->height();
pdman.set2f(fScaleUni, SkScalarToFloat(scaleX),
- colorTex->origin() == kTopLeft_GrSurfaceOrigin ?
+ proxy->origin() == kTopLeft_GrSurfaceOrigin ?
SkScalarToFloat(scaleY) : SkScalarToFloat(-scaleY));
- fGLDomain.setData(pdman, displacementMap.domain(), colorTex);
+ fGLDomain.setData(pdman, displacementMap.domain(), proxy);
if (SkToBool(displacementMap.colorSpaceXform())) {
fColorSpaceHelper.setData(pdman, displacementMap.colorSpaceXform());
}