Allow TextureSamplers to have null GrTexture pointer
Bug: 715488
Change-Id: I69775cbb50d334d81872e236e59368fe65e698ff
Reviewed-on: https://skia-review.googlesource.com/14605
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 82f8880..5ad2ef2 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -203,9 +203,10 @@
// Currently we hardcode numbers to convert atlas coordinates to normalized floating point
SkASSERT(gp.numTextureSamplers() == 1);
GrTexture* atlas = gp.textureSampler(0).texture();
- SkASSERT(atlas);
- b->add32(atlas->width());
- b->add32(atlas->height());
+ if (atlas) {
+ b->add32(atlas->width());
+ b->add32(atlas->height());
+ }
}
private:
@@ -759,9 +760,10 @@
// Currently we hardcode numbers to convert atlas coordinates to normalized floating point
SkASSERT(gp.numTextureSamplers() == 1);
GrTexture* atlas = gp.textureSampler(0).texture();
- SkASSERT(atlas);
- b->add32(atlas->width());
- b->add32(atlas->height());
+ if (atlas) {
+ b->add32(atlas->width());
+ b->add32(atlas->height());
+ }
}
private: