Skip to content

Commit bc18f28

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Disable debugging code in the font renderer"
2 parents 7042613 + b629490 commit bc18f28

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

libs/hwui/Debug.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
// Turn on to display debug info about the layer renderer
6363
#define DEBUG_LAYER_RENDERER 0
6464

65+
// Turn on to enable additional debugging in the font renderers
66+
#define DEBUG_FONT_RENDERER 0
67+
6568
// Turn on to dump display list state
6669
#define DEBUG_DISPLAY_LIST 0
6770

libs/hwui/FontRenderer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
151151
int32_t bX = 0, bY = 0;
152152
for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) {
153153
for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) {
154+
#if DEBUG_FONT_RENDERER
154155
if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) {
155156
ALOGE("Skipping invalid index");
156157
continue;
157158
}
159+
#endif
158160
uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX];
159161
bitmap[bY * bitmapW + bX] = tempCol;
160162
}
@@ -226,7 +228,7 @@ void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len
226228
};
227229
RenderGlyph render = gRenderGlyph[mode];
228230

229-
if (positions == NULL) {
231+
if (CC_LIKELY(positions == NULL)) {
230232
SkFixed prevRsbDelta = 0;
231233

232234
float penX = x;

0 commit comments

Comments
 (0)