@@ -47,12 +47,12 @@ void TextLayoutCache::init() {
4747
4848 mDebugLevel = readRtlDebugLevel ();
4949 mDebugEnabled = mDebugLevel & kRtlDebugCaches ;
50- LOGD (" Using debug level: %d - Debug Enabled: %d" , mDebugLevel , mDebugEnabled );
50+ ALOGD (" Using debug level: %d - Debug Enabled: %d" , mDebugLevel , mDebugEnabled );
5151
5252 mCacheStartTime = systemTime (SYSTEM_TIME_MONOTONIC);
5353
5454 if (mDebugEnabled ) {
55- LOGD (" Initialization is done - Start time: %lld" , mCacheStartTime );
55+ ALOGD (" Initialization is done - Start time: %lld" , mCacheStartTime );
5656 }
5757
5858 mInitialized = true ;
@@ -89,7 +89,7 @@ void TextLayoutCache::operator()(TextLayoutCacheKey& text, sp<TextLayoutCacheVal
8989 size_t totalSizeToDelete = text.getSize () + desc->getSize ();
9090 mSize -= totalSizeToDelete;
9191 if (mDebugEnabled ) {
92- LOGD (" Cache value deleted, size = %d" , totalSizeToDelete);
92+ ALOGD (" Cache value deleted, size = %d" , totalSizeToDelete);
9393 }
9494 desc.clear ();
9595 }
@@ -138,7 +138,7 @@ sp<TextLayoutCacheValue> TextLayoutCache::getValue(SkPaint* paint,
138138 // Cleanup to make some room if needed
139139 if (mSize + size > mMaxSize ) {
140140 if (mDebugEnabled ) {
141- LOGD (" Need to clean some entries for making some room for a new entry" );
141+ ALOGD (" Need to clean some entries for making some room for a new entry" );
142142 }
143143 while (mSize + size > mMaxSize ) {
144144 // This will call the callback
@@ -157,15 +157,15 @@ sp<TextLayoutCacheValue> TextLayoutCache::getValue(SkPaint* paint,
157157 // Update timing information for statistics
158158 value->setElapsedTime (endTime - startTime);
159159
160- LOGD (" CACHE MISS: Added entry with "
160+ ALOGD (" CACHE MISS: Added entry with "
161161 " count=%d, entry size %d bytes, remaining space %d bytes"
162162 " - Compute time in nanos: %d - Text='%s' " ,
163163 count, size, mMaxSize - mSize , value->getElapsedTime (),
164164 String8 (text, count).string ());
165165 }
166166 } else {
167167 if (mDebugEnabled ) {
168- LOGD (" CACHE MISS: Calculated but not storing entry because it is too big "
168+ ALOGD (" CACHE MISS: Calculated but not storing entry because it is too big "
169169 " with start=%d count=%d contextCount=%d, "
170170 " entry size %d bytes, remaining space %d bytes"
171171 " - Compute time in nanos: %lld - Text='%s'" ,
@@ -184,7 +184,7 @@ sp<TextLayoutCacheValue> TextLayoutCache::getValue(SkPaint* paint,
184184 if (value->getElapsedTime () > 0 ) {
185185 float deltaPercent = 100 * ((value->getElapsedTime () - elapsedTimeThruCacheGet)
186186 / ((float )value->getElapsedTime ()));
187- LOGD (" CACHE HIT #%d with start=%d count=%d contextCount=%d"
187+ ALOGD (" CACHE HIT #%d with start=%d count=%d contextCount=%d"
188188 " - Compute time in nanos: %d - "
189189 " Cache get time in nanos: %lld - Gain in percent: %2.2f - Text='%s' " ,
190190 mCacheHitCount , start, count, contextCount,
@@ -202,17 +202,17 @@ sp<TextLayoutCacheValue> TextLayoutCache::getValue(SkPaint* paint,
202202void TextLayoutCache::dumpCacheStats () {
203203 float remainingPercent = 100 * ((mMaxSize - mSize ) / ((float )mMaxSize ));
204204 float timeRunningInSec = (systemTime (SYSTEM_TIME_MONOTONIC) - mCacheStartTime ) / 1000000000 ;
205- LOGD (" ------------------------------------------------" );
206- LOGD (" Cache stats" );
207- LOGD (" ------------------------------------------------" );
208- LOGD (" pid : %d" , getpid ());
209- LOGD (" running : %.0f seconds" , timeRunningInSec);
210- LOGD (" entries : %d" , mCache .size ());
211- LOGD (" size : %d bytes" , mMaxSize );
212- LOGD (" remaining : %d bytes or %2.2f percent" , mMaxSize - mSize , remainingPercent);
213- LOGD (" hits : %d" , mCacheHitCount );
214- LOGD (" saved : %lld milliseconds" , mNanosecondsSaved / 1000000 );
215- LOGD (" ------------------------------------------------" );
205+ ALOGD (" ------------------------------------------------" );
206+ ALOGD (" Cache stats" );
207+ ALOGD (" ------------------------------------------------" );
208+ ALOGD (" pid : %d" , getpid ());
209+ ALOGD (" running : %.0f seconds" , timeRunningInSec);
210+ ALOGD (" entries : %d" , mCache .size ());
211+ ALOGD (" size : %d bytes" , mMaxSize );
212+ ALOGD (" remaining : %d bytes or %2.2f percent" , mMaxSize - mSize , remainingPercent);
213+ ALOGD (" hits : %d" , mCacheHitCount );
214+ ALOGD (" saved : %lld milliseconds" , mNanosecondsSaved / 1000000 );
215+ ALOGD (" ------------------------------------------------" );
216216}
217217
218218/* *
@@ -320,7 +320,7 @@ void TextLayoutCacheValue::computeValues(SkPaint* paint, const UChar* chars,
320320 computeValuesWithHarfbuzz (paint, chars, start, count, contextCount, dirFlags,
321321 &mAdvances , &mTotalAdvance , &mGlyphs );
322322#if DEBUG_ADVANCES
323- LOGD (" Advances - start=%d, count=%d, countextCount=%d, totalAdvance=%f" , start, count,
323+ ALOGD (" Advances - start=%d, count=%d, countextCount=%d, totalAdvance=%f" , start, count,
324324 contextCount, mTotalAdvance );
325325#endif
326326}
@@ -435,14 +435,14 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
435435 if (bidi) {
436436 UErrorCode status = U_ZERO_ERROR;
437437#if DEBUG_GLYPHS
438- LOGD (" computeValuesWithHarfbuzz -- bidiReq=%d" , bidiReq);
438+ ALOGD (" computeValuesWithHarfbuzz -- bidiReq=%d" , bidiReq);
439439#endif
440440 ubidi_setPara (bidi, chars, contextCount, bidiReq, NULL , &status);
441441 if (U_SUCCESS (status)) {
442442 int paraDir = ubidi_getParaLevel (bidi) & kDirection_Mask ; // 0 if ltr, 1 if rtl
443443 ssize_t rc = ubidi_countRuns (bidi, &status);
444444#if DEBUG_GLYPHS
445- LOGD (" computeValuesWithHarfbuzz -- dirFlags=%d run-count=%d paraDir=%d" ,
445+ ALOGD (" computeValuesWithHarfbuzz -- dirFlags=%d run-count=%d paraDir=%d" ,
446446 dirFlags, rc, paraDir);
447447#endif
448448 if (U_SUCCESS (status) && rc == 1 ) {
@@ -490,7 +490,7 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
490490 isRTL = (runDir == UBIDI_RTL);
491491 jfloat runTotalAdvance = 0 ;
492492#if DEBUG_GLYPHS
493- LOGD (" computeValuesWithHarfbuzz -- run-start=%d run-len=%d isRTL=%d" ,
493+ ALOGD (" computeValuesWithHarfbuzz -- run-start=%d run-len=%d isRTL=%d" ,
494494 startRun, lengthRun, isRTL);
495495#endif
496496 computeRunValuesWithHarfbuzz (shaperItem, paint,
@@ -516,7 +516,7 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
516516 // Default single run case
517517 if (useSingleRun){
518518#if DEBUG_GLYPHS
519- LOGD (" computeValuesWithHarfbuzz -- Using a SINGLE Run "
519+ ALOGD (" computeValuesWithHarfbuzz -- Using a SINGLE Run "
520520 " -- run-start=%d run-len=%d isRTL=%d" , start, count, isRTL);
521521#endif
522522 computeRunValuesWithHarfbuzz (shaperItem, paint,
@@ -528,14 +528,14 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
528528 freeShaperItem (shaperItem);
529529
530530#if DEBUG_GLYPHS
531- LOGD (" computeValuesWithHarfbuzz -- total-glyphs-count=%d" , outGlyphs->size ());
531+ ALOGD (" computeValuesWithHarfbuzz -- total-glyphs-count=%d" , outGlyphs->size ());
532532#endif
533533}
534534
535535static void logGlyphs (HB_ShaperItem shaperItem) {
536- LOGD (" Got glyphs - count=%d" , shaperItem.num_glyphs );
536+ ALOGD (" Got glyphs - count=%d" , shaperItem.num_glyphs );
537537 for (size_t i = 0 ; i < shaperItem.num_glyphs ; i++) {
538- LOGD (" glyph[%d]=%d - offset.x=%f offset.y=%f" , i, shaperItem.glyphs [i],
538+ ALOGD (" glyph[%d]=%d - offset.x=%f offset.y=%f" , i, shaperItem.glyphs [i],
539539 HBFixedToFloat (shaperItem.offsets [i].x ),
540540 HBFixedToFloat (shaperItem.offsets [i].y ));
541541 }
@@ -553,17 +553,17 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(HB_ShaperItem& shaperIte
553553 shapeRun (shaperItem, start, count, isRTL);
554554
555555#if DEBUG_GLYPHS
556- LOGD (" HARFBUZZ -- num_glypth=%d - kerning_applied=%d" , shaperItem.num_glyphs ,
556+ ALOGD (" HARFBUZZ -- num_glypth=%d - kerning_applied=%d" , shaperItem.num_glyphs ,
557557 shaperItem.kerning_applied );
558- LOGD (" -- string= '%s'" , String8 (shaperItem.string + start, count).string ());
559- LOGD (" -- isDevKernText=%d" , paint->isDevKernText ());
558+ ALOGD (" -- string= '%s'" , String8 (shaperItem.string + start, count).string ());
559+ ALOGD (" -- isDevKernText=%d" , paint->isDevKernText ());
560560
561561 logGlyphs (shaperItem);
562562#endif
563563
564564 if (shaperItem.advances == NULL || shaperItem.num_glyphs == 0 ) {
565565#if DEBUG_GLYPHS
566- LOGD (" HARFBUZZ -- advances array is empty or num_glypth = 0" );
566+ ALOGD (" HARFBUZZ -- advances array is empty or num_glypth = 0" );
567567#endif
568568 outAdvances->insertAt (0 , outAdvances->size (), count);
569569 *outTotalAdvance = 0 ;
@@ -589,7 +589,7 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(HB_ShaperItem& shaperIte
589589
590590#if DEBUG_ADVANCES
591591 for (size_t i = 0 ; i < count; i++) {
592- LOGD (" hb-adv[%d] = %f - log_clusters = %d - total = %f" , i,
592+ ALOGD (" hb-adv[%d] = %f - log_clusters = %d - total = %f" , i,
593593 (*outAdvances)[i], shaperItem.log_clusters [i], totalAdvance);
594594 }
595595#endif
@@ -600,7 +600,7 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(HB_ShaperItem& shaperIte
600600 for (size_t i = 0 ; i < countGlyphs; i++) {
601601 jchar glyph = (jchar) shaperItem.glyphs [(!isRTL) ? i : countGlyphs - 1 - i];
602602#if DEBUG_GLYPHS
603- LOGD (" HARFBUZZ -- glyph[%d]=%d" , i, glyph);
603+ ALOGD (" HARFBUZZ -- glyph[%d]=%d" , i, glyph);
604604#endif
605605 outGlyphs->add (glyph);
606606 }
0 commit comments