Merge "Disable debugging code in the font renderer"
This commit is contained in:
@@ -62,6 +62,9 @@
|
|||||||
// Turn on to display debug info about the layer renderer
|
// Turn on to display debug info about the layer renderer
|
||||||
#define DEBUG_LAYER_RENDERER 0
|
#define DEBUG_LAYER_RENDERER 0
|
||||||
|
|
||||||
|
// Turn on to enable additional debugging in the font renderers
|
||||||
|
#define DEBUG_FONT_RENDERER 0
|
||||||
|
|
||||||
// Turn on to dump display list state
|
// Turn on to dump display list state
|
||||||
#define DEBUG_DISPLAY_LIST 0
|
#define DEBUG_DISPLAY_LIST 0
|
||||||
|
|
||||||
|
|||||||
@@ -151,10 +151,12 @@ void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
|
|||||||
int32_t bX = 0, bY = 0;
|
int32_t bX = 0, bY = 0;
|
||||||
for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) {
|
for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) {
|
||||||
for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) {
|
for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) {
|
||||||
|
#if DEBUG_FONT_RENDERER
|
||||||
if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) {
|
if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) {
|
||||||
ALOGE("Skipping invalid index");
|
ALOGE("Skipping invalid index");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX];
|
uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX];
|
||||||
bitmap[bY * bitmapW + bX] = tempCol;
|
bitmap[bY * bitmapW + bX] = tempCol;
|
||||||
}
|
}
|
||||||
@@ -226,7 +228,7 @@ void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len
|
|||||||
};
|
};
|
||||||
RenderGlyph render = gRenderGlyph[mode];
|
RenderGlyph render = gRenderGlyph[mode];
|
||||||
|
|
||||||
if (positions == NULL) {
|
if (CC_LIKELY(positions == NULL)) {
|
||||||
SkFixed prevRsbDelta = 0;
|
SkFixed prevRsbDelta = 0;
|
||||||
|
|
||||||
float penX = x;
|
float penX = x;
|
||||||
|
|||||||
Reference in New Issue
Block a user