summaryrefslogtreecommitdiff
path: root/libs/hwui/GradientCache.h
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2016-10-12 12:14:07 -0700
committer Romain Guy <romainguy@google.com> 2016-10-12 13:28:26 -0700
commit8762e332e3797fb41929a1c6069207f4906ca329 (patch)
treeb97249defbda418d2adc8af6f4bb22dfa3def07f /libs/hwui/GradientCache.h
parent21986f2ae73e9ae3395a37dd3976af55e75d4f9d (diff)
Various fixes for linear blending and gradients
With linear blending turned off some textures were still created as sRGB textures instead of linear textures. Multi-stop gradients were not behaving properly on devices with no support for float textures. Gradients are now always interpolated in linear space even if linear blending is off. New functions to always force sRGB->linear->sRGB conversions. Test: Manual testing Bug: 29940137 Change-Id: Ie2f84ee2a65fd85570e88af813e841e0e625df6c
Diffstat (limited to 'libs/hwui/GradientCache.h')
-rw-r--r--libs/hwui/GradientCache.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/hwui/GradientCache.h b/libs/hwui/GradientCache.h
index 3fd8e80dd64b..5e35435ed64c 100644
--- a/libs/hwui/GradientCache.h
+++ b/libs/hwui/GradientCache.h
@@ -154,11 +154,13 @@ private:
size_t bytesPerPixel() const;
size_t sourceBytesPerPixel() const;
- typedef void (GradientCache::*ChannelMixer)(FloatColor& start, FloatColor& end,
+ typedef void (GradientCache::*ChannelMixer)(const FloatColor& start, const FloatColor& end,
float amount, uint8_t*& dst) const;
- void mixBytes(FloatColor& start, FloatColor& end, float amount, uint8_t*& dst) const;
- void mixFloats(FloatColor& start, FloatColor& end, float amount, uint8_t*& dst) const;
+ void mixBytes(const FloatColor& start, const FloatColor& end,
+ float amount, uint8_t*& dst) const;
+ void mixFloats(const FloatColor& start, const FloatColor& end,
+ float amount, uint8_t*& dst) const;
LruCache<GradientCacheEntry, Texture*> mCache;