diff options
author | Robert Phillips <robertphillips@google.com> | 2017-07-21 14:17:45 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-21 14:17:54 +0000 |
commit | 96be9df1300b2281641b038ef11064157f6e0b41 (patch) | |
tree | 2d7c80612daa3fd76114fe158fe2857cce9b2cb0 /src/gpu/effects/GrTextureDomain.cpp | |
parent | 7877d3237826fc4985af3e9d540cff79e408ef34 (diff) |
Revert "Reduce dependence on GrSurface's origin field"
This reverts commit 467022b1861033d968195687da15270c208279ff.
Reason for revert: GrAHardwareBufferImageGenerator.cpp
Original change's description:
> Reduce dependence on GrSurface's origin field
>
> Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL.
>
> Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d
> Reviewed-on: https://skia-review.googlesource.com/24700
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
Change-Id: I1b3f5c3b82d250ac164beb1d5c83abb6c3c6ab3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/25620
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/effects/GrTextureDomain.cpp')
-rw-r--r-- | src/gpu/effects/GrTextureDomain.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index f2b78586d7..a8ce0ab6c5 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -161,8 +161,7 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder, void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman, const GrTextureDomain& textureDomain, - GrSurfaceProxy* proxy) { - GrTexture* tex = proxy->priv().peekTexture(); + GrTexture* tex) { SkASSERT(textureDomain.mode() == fMode); if (kIgnore_Mode != textureDomain.mode()) { SkScalar wInv = SK_Scalar1 / tex->width(); @@ -181,7 +180,7 @@ void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman, SkASSERT(values[3] >= 0.0f && values[3] <= 1.0f); // vertical flip if necessary - if (kBottomLeft_GrSurfaceOrigin == proxy->origin()) { + if (kBottomLeft_GrSurfaceOrigin == tex->origin()) { values[1] = 1.0f - values[1]; values[3] = 1.0f - values[3]; // The top and bottom were just flipped, so correct the ordering @@ -271,9 +270,9 @@ GrGLSLFragmentProcessor* GrTextureDomainEffect::onCreateGLSLInstance() const { const GrFragmentProcessor& fp) override { const GrTextureDomainEffect& tde = fp.cast<GrTextureDomainEffect>(); const GrTextureDomain& domain = tde.fTextureDomain; - GrSurfaceProxy* proxy = tde.textureSampler(0).proxy(); + GrTexture* texture = tde.textureSampler(0).peekTexture(); - fGLDomain.setData(pdman, domain, proxy); + fGLDomain.setData(pdman, domain, texture); if (SkToBool(tde.colorSpaceXform())) { fColorSpaceHelper.setData(pdman, tde.colorSpaceXform()); } @@ -373,17 +372,16 @@ GrGLSLFragmentProcessor* GrDeviceSpaceTextureDecalFragmentProcessor::onCreateGLS const GrFragmentProcessor& fp) override { const GrDeviceSpaceTextureDecalFragmentProcessor& dstdfp = fp.cast<GrDeviceSpaceTextureDecalFragmentProcessor>(); - GrSurfaceProxy* proxy = dstdfp.textureSampler(0).proxy(); - GrTexture* texture = proxy->priv().peekTexture(); + GrTexture* texture = dstdfp.textureSampler(0).peekTexture(); - fGLDomain.setData(pdman, dstdfp.fTextureDomain, proxy); + fGLDomain.setData(pdman, dstdfp.fTextureDomain, texture); float iw = 1.f / texture->width(); float ih = 1.f / texture->height(); float scaleAndTransData[4] = { iw, ih, -dstdfp.fDeviceSpaceOffset.fX * iw, -dstdfp.fDeviceSpaceOffset.fY * ih }; - if (proxy->origin() == kBottomLeft_GrSurfaceOrigin) { + if (texture->origin() == kBottomLeft_GrSurfaceOrigin) { scaleAndTransData[1] = -scaleAndTransData[1]; scaleAndTransData[3] = 1 - scaleAndTransData[3]; } |