summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2013-07-25 11:45:53 +0530
committerAmit Pundir <amit.pundir@linaro.org>2013-07-25 11:45:53 +0530
commit8d38f0ef7308338cdf47ebb58c34ae6456e4afbb (patch)
tree8835819add985227d593972aa1baf7d6b6c6cc54
parent292af61ae0c23492827890346c4f530c671443b3 (diff)
downloadbase-8d38f0ef7308338cdf47ebb58c34ae6456e4afbb.tar.gz
frameworks/base: Fix compile errors
Fix ISO C++11 incompatibility in TextLayoutCache and aliasing violation in FontRenderer Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index ec8e8f3e8c30..5b43d8bf98fa 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -143,7 +143,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
"This indicates that the cache already has an entry with the "
"same key but it should not since we checked earlier!"
" - start = %d, count = %d, contextCount = %d - Text = '%s'",
- start, count, contextCount, String8(key.getText() + start, count).string());
+ start, count, contextCount, String8(reinterpret_cast<const char16_t*>(key.getText() + start), count).string());
if (mDebugEnabled) {
nsecs_t totalTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
@@ -154,7 +154,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
value.get(), start, count, contextCount, size, mMaxSize - mSize,
value->getElapsedTime() * 0.000001f,
(totalTime - value->getElapsedTime()) * 0.000001f,
- String8(key.getText() + start, count).string());
+ String8(reinterpret_cast<const char16_t*>(key.getText() + start), count).string());
}
} else {
if (mDebugEnabled) {
@@ -164,7 +164,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
" - Compute time %0.6f ms - Text = '%s'",
start, count, contextCount, size, mMaxSize - mSize,
value->getElapsedTime() * 0.000001f,
- String8(key.getText() + start, count).string());
+ String8(reinterpret_cast<const char16_t*>(key.getText() + start), count).string());
}
}
} else {
@@ -184,7 +184,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
value->getElapsedTime() * 0.000001f,
elapsedTimeThruCacheGet * 0.000001f,
deltaPercent,
- String8(key.getText() + start, count).string());
+ String8(reinterpret_cast<const char16_t*>(key.getText() + start), count).string());
}
if (mCacheHitCount % DEFAULT_DUMP_STATS_CACHE_HIT_INTERVAL == 0) {
dumpCacheStats();
@@ -226,7 +226,7 @@ TextLayoutCacheKey::TextLayoutCacheKey(const SkPaint* paint, const UChar* text,
size_t start, size_t count, size_t contextCount, int dirFlags) :
start(start), count(count), contextCount(contextCount),
dirFlags(dirFlags) {
- textCopy.setTo(text, contextCount);
+ textCopy.setTo(reinterpret_cast<const char16_t*>(text), contextCount);
typeface = paint->getTypeface();
textSize = paint->getTextSize();
textSkewX = paint->getTextSkewX();