summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2011-05-12 17:42:06 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2011-05-13 11:07:38 -0700
commit2ea75880142152b3a9993cb245754d73c05749a7 (patch)
tree35cc62ca30c9a4446a96ad674936dbe6652cfc6c /core/jni/android
parentf470ced7cdb10a112a526339f92840587918aa6b (diff)
downloadframeworks_base-2ea75880142152b3a9993cb245754d73c05749a7.zip
frameworks_base-2ea75880142152b3a9993cb245754d73c05749a7.tar.gz
frameworks_base-2ea75880142152b3a9993cb245754d73c05749a7.tar.bz2
Prepare OpenGLRenderer to use glyphs from TextLayoutCache
- add OpenGLRenderer.drawGlyph() - refactor glypth logging code Change-Id: I797e6f1304d3f3f8f6ed31e7f9965d336233d2a4
Diffstat (limited to 'core/jni/android')
-rw-r--r--core/jni/android/graphics/Canvas.cpp11
-rw-r--r--core/jni/android/graphics/TextLayout.h8
2 files changed, 10 insertions, 9 deletions
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index 2dceab9..9d9196e 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -764,13 +764,6 @@ public:
env->ReleaseStringChars(text, textArray);
}
- static void logGlyphs(sp<TextLayoutCacheValue> value) {
- LOGD("drawTextWithGlyphs -- got glyphs - count=%d", value->getGlyphsCount());
- for (size_t i = 0; i < value->getGlyphsCount(); i++) {
- LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]);
- }
- }
-
static void drawTextWithGlyphs(SkCanvas* canvas, const jchar* textArray,
int start, int end,
jfloat x, jfloat y, int flags, SkPaint* paint) {
@@ -779,7 +772,7 @@ public:
sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue(
paint, textArray, start, count, count, flags);
if (value == NULL) {
- LOGE("drawTextWithGlyphs -- cannot get Cache value");
+ LOGE("Cannot get TextLayoutCache value");
return ;
}
#if DEBUG_GLYPHS
@@ -796,7 +789,7 @@ public:
sp<TextLayoutCacheValue> value = gTextLayoutCache.getValue(
paint, textArray, start, count, contextCount, flags);
if (value == NULL) {
- LOGE("drawTextWithGlyphs -- cannot get Cache value");
+ LOGE("Cannot get TextLayoutCache value");
return ;
}
#if DEBUG_GLYPHS
diff --git a/core/jni/android/graphics/TextLayout.h b/core/jni/android/graphics/TextLayout.h
index 9bb1b92..d197d04 100644
--- a/core/jni/android/graphics/TextLayout.h
+++ b/core/jni/android/graphics/TextLayout.h
@@ -64,6 +64,14 @@ enum {
kDirection_Mask = 0x1
};
+static void logGlyphs(sp<TextLayoutCacheValue> value) {
+ if (value == NULL) return;
+ LOGD("Got glyphs - count=%d", value->getGlyphsCount());
+ for (size_t i = 0; i < value->getGlyphsCount(); i++) {
+ LOGD(" glyphs[%d]=%d", i, value->getGlyphs()[i]);
+ }
+}
+
class TextLayout {
public: