diff options
author | Robert Phillips <robertphillips@google.com> | 2017-05-29 12:37:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-29 17:04:51 +0000 |
commit | 9bee2e5894bb8dd374392f238bc429e16f239583 (patch) | |
tree | 975ace2218b6911b62c9c9abceb2545cba9e5150 /src/effects | |
parent | 761717146923163991aeb32d50f05a2bdf471dc4 (diff) |
Revise system for checking for uninstantiated proxies
The new pattern is:
we will "instantiate" pipelines at flush time
at flush time we will only access the backing GrSurface by peeking
If instantiation fails we should never try to access the GrSurfaces
Change-Id: I87f7ff41bd0e84d9ca3dbdd61d3361d3d4ceefd6
Reviewed-on: https://skia-review.googlesource.com/17932
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkMagnifierImageFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 2c0d5f014f..cd481a1239 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -653,7 +653,8 @@ void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) { void GrGLDisplacementMapEffect::onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& proc) { const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMapEffect>(); - GrTexture* colorTex = displacementMap.textureSampler(1).texture(); + GrTexture* colorTex = displacementMap.textureSampler(1).peekTexture(); + SkScalar scaleX = displacementMap.scale().fX / colorTex->width(); SkScalar scaleY = displacementMap.scale().fY / colorTex->height(); pdman.set2f(fScaleUni, SkScalarToFloat(scaleX), diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index e6c4661e02..c856841f2a 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -1932,7 +1932,8 @@ void GrGLLightingEffect::onSetData(const GrGLSLProgramDataManager& pdman, fLight = lighting.light()->createGLLight(); } - GrTexture* texture = lighting.textureSampler(0).texture(); + GrTexture* texture = lighting.textureSampler(0).peekTexture(); + float ySign = texture->origin() == kTopLeft_GrSurfaceOrigin ? -1.0f : 1.0f; pdman.set2f(fImageIncrementUni, 1.0f / texture->width(), ySign / texture->height()); pdman.set1f(fSurfaceScaleUni, lighting.surfaceScale()); diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 8e289e5c4c..197b8055d5 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -204,8 +204,7 @@ void GrGLMagnifierEffect::onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& effect) { const GrMagnifierEffect& zoom = effect.cast<GrMagnifierEffect>(); - GrTexture* tex = zoom.textureSampler(0).texture(); - SkASSERT(tex); + GrTexture* tex = zoom.textureSampler(0).peekTexture(); SkScalar invW = 1.0f / tex->width(); SkScalar invH = 1.0f / tex->height(); diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index e783488e7b..57abec9ebf 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -294,7 +294,7 @@ void GrGLMorphologyEffect::GenKey(const GrProcessor& proc, void GrGLMorphologyEffect::onSetData(const GrGLSLProgramDataManager& pdman, const GrFragmentProcessor& proc) { const GrMorphologyEffect& m = proc.cast<GrMorphologyEffect>(); - GrTexture& texture = *m.textureSampler(0).texture(); + GrTexture& texture = *m.textureSampler(0).peekTexture(); float pixelSize = 0.0f; switch (m.direction()) { |