Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: src/core/SkBitmapFilter.h

Issue 1683743005: Simple cleanups related to SkFixed. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkBitmapFilter.h
diff --git a/src/core/SkBitmapFilter.h b/src/core/SkBitmapFilter.h
index dc3ea693b83f8f04057ce79dea064ee5ca8ae14f..b3419624a0bf9327fc66185298506a04472f63c7 100644
--- a/src/core/SkBitmapFilter.h
+++ b/src/core/SkBitmapFilter.h
@@ -30,15 +30,6 @@ public:
}
virtual ~SkBitmapFilter() {}
- SkFixed lookup(float x) const {
- if (!fPrecomputed) {
- precomputeTable();
- }
- int filter_idx = int(sk_float_abs(x * fLookupMultiplier));
- SkASSERT(filter_idx < SKBITMAP_FILTER_TABLE_SIZE);
- return fFilterTable[filter_idx];
- }
-
SkScalar lookupScalar(float x) const {
if (!fPrecomputed) {
precomputeTable();
@@ -71,19 +62,16 @@ protected:
float fLookupMultiplier;
mutable bool fPrecomputed;
- mutable SkFixed fFilterTable[SKBITMAP_FILTER_TABLE_SIZE];
mutable SkScalar fFilterTableScalar[SKBITMAP_FILTER_TABLE_SIZE];
private:
void precomputeTable() const {
fPrecomputed = true;
- SkFixed *ftp = fFilterTable;
SkScalar *ftpScalar = fFilterTableScalar;
for (int x = 0; x < SKBITMAP_FILTER_TABLE_SIZE; ++x) {
float fx = ((float)x + .5f) * this->width() / SKBITMAP_FILTER_TABLE_SIZE;
float filter_value = evaluate(fx);
*ftpScalar++ = filter_value;
- *ftp++ = SkFloatToFixed(filter_value);
}
}
};

Powered by Google App Engine
This is Rietveld 408576698