summaryrefslogtreecommitdiffstats
path: root/libs/hwui/font
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/font')
-rw-r--r--libs/hwui/font/CacheTexture.cpp1
-rw-r--r--libs/hwui/font/CacheTexture.h1
-rw-r--r--libs/hwui/font/CachedGlyphInfo.h4
-rw-r--r--libs/hwui/font/Font.cpp23
-rw-r--r--libs/hwui/font/Font.h6
5 files changed, 16 insertions, 19 deletions
diff --git a/libs/hwui/font/CacheTexture.cpp b/libs/hwui/font/CacheTexture.cpp
index 24ffb80..380c0ed 100644
--- a/libs/hwui/font/CacheTexture.cpp
+++ b/libs/hwui/font/CacheTexture.cpp
@@ -17,6 +17,7 @@
#include <SkGlyph.h>
#include "CacheTexture.h"
+#include "FontUtil.h"
#include "../Caches.h"
#include "../Debug.h"
#include "../Extensions.h"
diff --git a/libs/hwui/font/CacheTexture.h b/libs/hwui/font/CacheTexture.h
index 4cc4f22..a107c7a 100644
--- a/libs/hwui/font/CacheTexture.h
+++ b/libs/hwui/font/CacheTexture.h
@@ -23,7 +23,6 @@
#include <utils/Log.h>
-#include "FontUtil.h"
#include "../PixelBuffer.h"
#include "../Rect.h"
#include "../Vertex.h"
diff --git a/libs/hwui/font/CachedGlyphInfo.h b/libs/hwui/font/CachedGlyphInfo.h
index 6680a00..0642d59 100644
--- a/libs/hwui/font/CachedGlyphInfo.h
+++ b/libs/hwui/font/CachedGlyphInfo.h
@@ -19,11 +19,11 @@
#include <SkFixed.h>
-#include "CacheTexture.h"
-
namespace android {
namespace uirenderer {
+class CacheTexture;
+
struct CachedGlyphInfo {
// Has the cache been invalidated?
bool mIsValid;
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index e1a38dd..2e6c528 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -22,6 +22,7 @@
#include <utils/JenkinsHash.h>
#include <utils/Trace.h>
+#include <SkDeviceProperties.h>
#include <SkGlyph.h>
#include <SkGlyphCache.h>
#include <SkUtils.h>
@@ -41,9 +42,7 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
Font::Font(FontRenderer* state, const Font::FontDescription& desc) :
- mState(state), mDescription(desc) {
- mDeviceProperties = SkDeviceProperties::Make(SkDeviceProperties::Geometry::MakeDefault(), 1.0f);
-}
+ mState(state), mDescription(desc) { }
Font::FontDescription::FontDescription(const SkPaint* paint, const SkMatrix& rasterMatrix)
: mLookupTransform(rasterMatrix) {
@@ -139,8 +138,7 @@ void Font::invalidateTextureCache(CacheTexture* cacheTexture) {
}
void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
- uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds,
- const float* pos) {
+ uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
int width = (int) glyph->mBitmapWidth;
int height = (int) glyph->mBitmapHeight;
@@ -162,8 +160,7 @@ void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
}
void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
- uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds,
- const float* pos) {
+ uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
float width = (float) glyph->mBitmapWidth;
float height = (float) glyph->mBitmapHeight;
@@ -182,8 +179,7 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
}
void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y,
- uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds,
- const float* pos) {
+ uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
float width = (float) glyph->mBitmapWidth;
float height = (float) glyph->mBitmapHeight;
@@ -213,8 +209,7 @@ void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y,
}
void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap,
- uint32_t bitmapWidth, uint32_t bitmapHeight, Rect* bounds,
- const float* pos) {
+ uint32_t bitmapWidth, uint32_t bitmapHeight, Rect* bounds, const float* pos) {
int dstX = x + glyph->mBitmapLeft;
int dstY = y + glyph->mBitmapTop;
@@ -289,7 +284,8 @@ CachedGlyphInfo* Font::getCachedGlyph(const SkPaint* paint, glyph_t textUnit, bo
if (cachedGlyph) {
// Is the glyph still in texture cache?
if (!cachedGlyph->mIsValid) {
- SkAutoGlyphCache autoCache(*paint, &mDeviceProperties, &mDescription.mLookupTransform);
+ SkDeviceProperties deviceProperties(kUnknown_SkPixelGeometry, 1.0f);
+ SkAutoGlyphCache autoCache(*paint, &deviceProperties, &mDescription.mLookupTransform);
const SkGlyph& skiaGlyph = GET_METRICS(autoCache.getCache(), textUnit);
updateGlyphCache(paint, skiaGlyph, autoCache.getCache(), cachedGlyph, precaching);
}
@@ -479,7 +475,8 @@ CachedGlyphInfo* Font::cacheGlyph(const SkPaint* paint, glyph_t glyph, bool prec
CachedGlyphInfo* newGlyph = new CachedGlyphInfo();
mCachedGlyphs.add(glyph, newGlyph);
- SkAutoGlyphCache autoCache(*paint, &mDeviceProperties, &mDescription.mLookupTransform);
+ SkDeviceProperties deviceProperties(kUnknown_SkPixelGeometry, 1.0f);
+ SkAutoGlyphCache autoCache(*paint, &deviceProperties, &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 0f10464..d54bc44 100644
--- a/libs/hwui/font/Font.h
+++ b/libs/hwui/font/Font.h
@@ -22,13 +22,12 @@
#include <utils/KeyedVector.h>
#include <SkScalar.h>
-#include <SkDeviceProperties.h>
#include <SkGlyphCache.h>
#include <SkScalerContext.h>
#include <SkPaint.h>
#include <SkPathMeasure.h>
-#include "CachedGlyphInfo.h"
+#include "FontUtil.h"
#include "../Rect.h"
#include "../Matrix.h"
@@ -39,6 +38,8 @@ namespace uirenderer {
// Font
///////////////////////////////////////////////////////////////////////////////
+class CachedGlyphInfo;
+class CacheTexture;
class FontRenderer;
/**
@@ -150,7 +151,6 @@ private:
DefaultKeyedVector<glyph_t, CachedGlyphInfo*> mCachedGlyphs;
bool mIdentityTransform;
- SkDeviceProperties mDeviceProperties;
};
inline int strictly_order_type(const Font::FontDescription& lhs,