From 339859c3b476f9fd652afc76f5c44863c8a55d21 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 7 Oct 2010 08:59:15 +0100 Subject: [PATCH] bug 577707 - some Indic scripts rendered with incorrect font/glyphs on OS X. r=jdaggett a=blocking-betaN --- gfx/thebes/gfxFontUtils.h | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/gfx/thebes/gfxFontUtils.h b/gfx/thebes/gfxFontUtils.h index 0d5a6dd3b003..370ce351a98f 100644 --- a/gfx/thebes/gfxFontUtils.h +++ b/gfx/thebes/gfxFontUtils.h @@ -227,10 +227,7 @@ public: } Block *block = mBlocks[blockIndex]; if (!block) { - block = new Block; - if (NS_UNLIKELY(!block)) // OOM - return; - mBlocks[blockIndex] = block; + return; } block->mBits[(aIndex>>3) & (BLOCK_SIZE - 1)] &= ~(1 << (aIndex & 0x7)); } @@ -248,22 +245,12 @@ public: for (PRUint32 i = startIndex; i <= endIndex; ++i) { const PRUint32 blockFirstBit = i * BLOCK_SIZE_BITS; - const PRUint32 blockLastBit = blockFirstBit + BLOCK_SIZE_BITS - 1; Block *block = mBlocks[i]; if (!block) { - PRBool fullBlock = PR_FALSE; - if (aStart <= blockFirstBit && aEnd >= blockLastBit) - fullBlock = PR_TRUE; - - block = new Block(fullBlock ? 0xFF : 0); - - if (NS_UNLIKELY(!block)) // OOM - return; - mBlocks[i] = block; - - if (fullBlock) - continue; + // any nonexistent block is implicitly all clear, + // so there's no need to even create it + continue; } const PRUint32 start = aStart > blockFirstBit ? aStart - blockFirstBit : 0;