Add number ordering to SkFilterQuality
As explained in the bug, I would like to add a histogram to study how
users use the image smoothing quality in Chrome. In order to do that,
we need to ensure that the enums are not reordered or changed, so I
added kNone_SkFilterQuality = 0, etc. I also added kMaxValue for
histogram to work.
Bug: 1176091
Change-Id: I3af3213f699016a525caad5b0b51e0cc7aab2c52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368157
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Yi Xu <yiyix@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/include/core/SkFilterQuality.h b/include/core/SkFilterQuality.h
index 1f89517..04d3b6c 100644
--- a/include/core/SkFilterQuality.h
+++ b/include/core/SkFilterQuality.h
@@ -15,12 +15,13 @@
* e.g. images
*/
enum SkFilterQuality {
- kNone_SkFilterQuality, //!< fastest but lowest quality, typically nearest-neighbor
- kLow_SkFilterQuality, //!< typically bilerp
- kMedium_SkFilterQuality, //!< typically bilerp + mipmaps for down-scaling
- kHigh_SkFilterQuality, //!< slowest but highest quality, typically bicubic or better
+ kNone_SkFilterQuality = 0, //!< fastest but lowest quality, typically nearest-neighbor
+ kLow_SkFilterQuality = 1, //!< typically bilerp
+ kMedium_SkFilterQuality = 2, //!< typically bilerp + mipmaps for down-scaling
+ kHigh_SkFilterQuality = 3, //!< slowest but highest quality, typically bicubic or better
kLast_SkFilterQuality = kHigh_SkFilterQuality,
+ kMaxValue = kLast_SkFilterQuality,
};
#endif