Index: src/effects/gradients/SkClampRange.h |
diff --git a/src/effects/gradients/SkClampRange.h b/src/effects/gradients/SkClampRange.h |
index e970d4319f135f7739e6b811d3a25e12f3071b9a..945f9a7ff18311890ff2b58fad1ecd1cee0bc5f6 100644 |
--- a/src/effects/gradients/SkClampRange.h |
+++ b/src/effects/gradients/SkClampRange.h |
@@ -35,6 +35,15 @@ struct SkClampRange { |
void init(SkGradFixed fx, SkGradFixed dx, int count, int v0, int v1); |
+ void validate(int count) const { |
+#ifdef SK_DEBUG |
+ SkASSERT(fCount0 >= 0); |
+ SkASSERT(fCount1 >= 0); |
+ SkASSERT(fCount2 >= 0); |
+ SkASSERT(fCount0 + fCount1 + fCount2 == count); |
+#endif |
+ } |
+ |
private: |
void initFor1(SkGradFixed fx); |
}; |