summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-07-01 17:56:52 -0700
committerChris Craik <ccraik@google.com>2014-07-07 19:14:55 +0000
commit59744b79ec302000802cd56d30a1bf70f0183c80 (patch)
tree0057de9a24def27ca543608cd1d5b75b1b89bd57 /libs/hwui/font
parent904a1045ced36e844605b9764c3cb184976ea0a9 (diff)
downloadframeworks_base-59744b79ec302000802cd56d30a1bf70f0183c80.zip
frameworks_base-59744b79ec302000802cd56d30a1bf70f0183c80.tar.gz
frameworks_base-59744b79ec302000802cd56d30a1bf70f0183c80.tar.bz2
Add hack for custom re-rasterization buckets
bug:14083128 Moves all of the font transform management into OpenGLRenderer::findBestFontTransform(), and now simply passes down final rasterization transforms into the FontRenderer. Change-Id: Ie02752e6af863347b142367c7d628db5f9fc2998
Diffstat (limited to 'libs/hwui/font')
-rw-r--r--libs/hwui/font/Font.cpp8
-rw-r--r--libs/hwui/font/Font.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index a71db5b..2ea6c8c 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -45,7 +45,8 @@ Font::Font(FontRenderer* state, const Font::FontDescription& desc) :
mDeviceProperties = SkDeviceProperties::Make(SkDeviceProperties::Geometry::MakeDefault(), 1.0f);
}
-Font::FontDescription::FontDescription(const SkPaint* paint, const mat4& matrix) {
+Font::FontDescription::FontDescription(const SkPaint* paint, const SkMatrix& rasterMatrix)
+ : mLookupTransform(rasterMatrix) {
mFontId = SkTypeface::UniqueID(paint->getTypeface());
mFontSize = paint->getTextSize();
mFlags = 0;
@@ -58,9 +59,6 @@ Font::FontDescription::FontDescription(const SkPaint* paint, const mat4& matrix)
mStrokeWidth = paint->getStrokeWidth();
mAntiAliasing = paint->isAntiAlias();
mHinting = paint->getHinting();
- mLookupTransform.reset();
- mLookupTransform[SkMatrix::kMScaleX] = roundf(fmaxf(1.0f, matrix[mat4::kScaleX]));
- mLookupTransform[SkMatrix::kMScaleY] = roundf(fmaxf(1.0f, matrix[mat4::kScaleY]));
if (!mLookupTransform.invert(&mInverseLookupTransform)) {
ALOGW("Could not query the inverse lookup transform for this font");
}
@@ -486,7 +484,7 @@ CachedGlyphInfo* Font::cacheGlyph(const SkPaint* paint, glyph_t glyph, bool prec
return newGlyph;
}
-Font* Font::create(FontRenderer* state, const SkPaint* paint, const mat4& matrix) {
+Font* Font::create(FontRenderer* state, const SkPaint* paint, const SkMatrix& matrix) {
FontDescription description(paint, matrix);
Font* font = state->mActiveFonts.get(description);
diff --git a/libs/hwui/font/Font.h b/libs/hwui/font/Font.h
index 6ddd4f2..0f10464 100644
--- a/libs/hwui/font/Font.h
+++ b/libs/hwui/font/Font.h
@@ -17,6 +17,8 @@
#ifndef ANDROID_HWUI_FONT_H
#define ANDROID_HWUI_FONT_H
+#include <vector>
+
#include <utils/KeyedVector.h>
#include <SkScalar.h>
@@ -50,7 +52,7 @@ public:
};
struct FontDescription {
- FontDescription(const SkPaint* paint, const mat4& matrix);
+ FontDescription(const SkPaint* paint, const SkMatrix& matrix);
static int compare(const FontDescription& lhs, const FontDescription& rhs);
@@ -92,7 +94,7 @@ public:
/**
* Creates a new font associated with the specified font state.
*/
- static Font* create(FontRenderer* state, const SkPaint* paint, const mat4& matrix);
+ static Font* create(FontRenderer* state, const SkPaint* paint, const SkMatrix& matrix);
private:
friend class FontRenderer;