summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-02-02 15:16:30 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-02 15:16:30 -0800
commitbc18f289073a47b1cbf84fcd3e3e79c9d34c0990 (patch)
treef4e111a0bdf52386f9359f4576d1d27d560e66d4
parent7042613c653fd0de253f2f659901318902fa4584 (diff)
parentb629490ffb21752750cc081827ca4c1eae1eb015 (diff)
downloadframeworks_base-bc18f289073a47b1cbf84fcd3e3e79c9d34c0990.zip
frameworks_base-bc18f289073a47b1cbf84fcd3e3e79c9d34c0990.tar.gz
frameworks_base-bc18f289073a47b1cbf84fcd3e3e79c9d34c0990.tar.bz2
Merge "Disable debugging code in the font renderer"
-rw-r--r--libs/hwui/Debug.h3
-rw-r--r--libs/hwui/FontRenderer.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 0ad0c2a..16a3d73 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -62,6 +62,9 @@
// Turn on to display debug info about the layer renderer
#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
#define DEBUG_DISPLAY_LIST 0
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 74efda2..3df105b 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -151,10 +151,12 @@ void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
int32_t bX = 0, bY = 0;
for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) {
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) {
ALOGE("Skipping invalid index");
continue;
}
+#endif
uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX];
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];
- if (positions == NULL) {
+ if (CC_LIKELY(positions == NULL)) {
SkFixed prevRsbDelta = 0;
float penX = x;