diff options
author | 2017-07-21 14:12:29 -0400 | |
---|---|---|
committer | 2017-07-21 19:05:25 +0000 | |
commit | c686ce39f06d556d55befd290e0eb82851c7d33b (patch) | |
tree | d2d9cd464240a5a037ece559748ecedbb4293d0b /src/effects/SkMagnifierImageFilter.cpp | |
parent | 219f3622ba32a1cb6380212a2ec1947513fbfeb9 (diff) |
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>
Diffstat (limited to 'src/effects/SkMagnifierImageFilter.cpp')
-rw-r--r-- | src/effects/SkMagnifierImageFilter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 90e0a5c879..b2c6714828 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -202,14 +202,15 @@ void GrGLMagnifierEffect::onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& effect) { const GrMagnifierEffect& zoom = effect.cast<GrMagnifierEffect>(); - GrTexture* tex = zoom.textureSampler(0).peekTexture(); + GrSurfaceProxy* proxy = zoom.textureSampler(0).proxy(); + GrTexture* tex = proxy->priv().peekTexture(); SkScalar invW = 1.0f / tex->width(); SkScalar invH = 1.0f / tex->height(); { SkScalar y = zoom.srcRect().y() * invH; - if (tex->origin() != kTopLeft_GrSurfaceOrigin) { + if (proxy->origin() != kTopLeft_GrSurfaceOrigin) { y = 1.0f - (zoom.srcRect().height() / zoom.bounds().height()) - y; } @@ -221,7 +222,7 @@ void GrGLMagnifierEffect::onSetData(const GrGLSLProgramDataManager& pdman, { SkScalar y = zoom.bounds().y() * invH; - if (tex->origin() != kTopLeft_GrSurfaceOrigin) { + if (proxy->origin() != kTopLeft_GrSurfaceOrigin) { y = 1.0f - zoom.bounds().height() * invH; } |