summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2014-04-22 22:57:29 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-22 22:57:29 +0000
commit2c423b22b42269c0652dff4155707cec823fbfc1 (patch)
tree29127ef052e06bcf85c66e264fa78a1ce8af11b0 /libs
parent9a492393dfb69050b2a4a8b5205e8d2fc24fcd43 (diff)
parentdf64ac688d400c74438db091952d236fffd5f778 (diff)
downloadframeworks_base-2c423b22b42269c0652dff4155707cec823fbfc1.zip
frameworks_base-2c423b22b42269c0652dff4155707cec823fbfc1.tar.gz
frameworks_base-2c423b22b42269c0652dff4155707cec823fbfc1.tar.bz2
am df64ac68: ask skia to use flat gamma when rendering fonts from hwui
* commit 'df64ac688d400c74438db091952d236fffd5f778': ask skia to use flat gamma when rendering fonts from hwui
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/font/Font.cpp5
-rw-r--r--libs/hwui/font/Font.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index 436dcef..0a6e6ef 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -42,6 +42,7 @@ namespace uirenderer {
Font::Font(FontRenderer* state, const Font::FontDescription& desc) :
mState(state), mDescription(desc) {
+ mDeviceProperties = SkDeviceProperties::Make(SkDeviceProperties::Geometry::MakeDefault(), 1.0f);
}
Font::FontDescription::FontDescription(const SkPaint* paint, const mat4& matrix) {
@@ -272,7 +273,7 @@ CachedGlyphInfo* Font::getCachedGlyph(SkPaint* paint, glyph_t textUnit, bool pre
if (cachedGlyph) {
// Is the glyph still in texture cache?
if (!cachedGlyph->mIsValid) {
- SkAutoGlyphCache autoCache(*paint, NULL, &mDescription.mLookupTransform);
+ SkAutoGlyphCache autoCache(*paint, &mDeviceProperties, &mDescription.mLookupTransform);
const SkGlyph& skiaGlyph = GET_METRICS(autoCache.getCache(), textUnit);
updateGlyphCache(paint, skiaGlyph, autoCache.getCache(), cachedGlyph, precaching);
}
@@ -464,7 +465,7 @@ CachedGlyphInfo* Font::cacheGlyph(SkPaint* paint, glyph_t glyph, bool precaching
CachedGlyphInfo* newGlyph = new CachedGlyphInfo();
mCachedGlyphs.add(glyph, newGlyph);
- SkAutoGlyphCache autoCache(*paint, NULL, &mDescription.mLookupTransform);
+ SkAutoGlyphCache autoCache(*paint, &mDeviceProperties, &mDescription.mLookupTransform);
const SkGlyph& skiaGlyph = GET_METRICS(autoCache.getCache(), glyph);
newGlyph->mIsValid = false;
newGlyph->mGlyphIndex = skiaGlyph.fID;
diff --git a/libs/hwui/font/Font.h b/libs/hwui/font/Font.h
index f68b430..1e0e0c8 100644
--- a/libs/hwui/font/Font.h
+++ b/libs/hwui/font/Font.h
@@ -19,6 +19,8 @@
#include <utils/KeyedVector.h>
+#include <SkScalar.h>
+#include <SkDeviceProperties.h>
#include <SkGlyphCache.h>
#include <SkScalerContext.h>
#include <SkPaint.h>
@@ -145,6 +147,7 @@ private:
DefaultKeyedVector<glyph_t, CachedGlyphInfo*> mCachedGlyphs;
bool mIdentityTransform;
+ SkDeviceProperties mDeviceProperties;
};
inline int strictly_order_type(const Font::FontDescription& lhs,