am ebec4b6e: Merge "fix kBW_Format glyphs" into klp-dev

* commit 'ebec4b6e381b9035a37e7fccc88be564a90bd4ec':
  fix kBW_Format glyphs
This commit is contained in:
Victoria Lease
2013-08-12 15:56:06 -07:00
committed by Android Git Automerger
2 changed files with 5 additions and 2 deletions

View File

@@ -234,6 +234,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
Vector<CacheTexture*>* cacheTextures = NULL; Vector<CacheTexture*>* cacheTextures = NULL;
switch (format) { switch (format) {
case SkMask::kA8_Format: case SkMask::kA8_Format:
case SkMask::kBW_Format:
cacheTextures = &mACacheTextures; cacheTextures = &mACacheTextures;
break; break;
case SkMask::kARGB32_Format: case SkMask::kARGB32_Format:

View File

@@ -233,9 +233,11 @@ void CacheTexture::setDirty(bool dirty) {
bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint32_t* retOriginY) { bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint32_t* retOriginY) {
switch (glyph.fMaskFormat) { switch (glyph.fMaskFormat) {
case SkMask::kA8_Format: case SkMask::kA8_Format:
case SkMask::kBW_Format:
if (mFormat != GL_ALPHA) { if (mFormat != GL_ALPHA) {
#if DEBUG_FONT_RENDERER #if DEBUG_FONT_RENDERER
ALOGD("fitBitmap: kA8_Format glyph cannot fit into texture format %x", mFormat); ALOGD("fitBitmap: texture format %x is inappropriate for monochromatic glyphs",
mFormat);
#endif #endif
return false; return false;
} }
@@ -243,7 +245,7 @@ bool CacheTexture::fitBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint32_
case SkMask::kARGB32_Format: case SkMask::kARGB32_Format:
if (mFormat != GL_RGBA) { if (mFormat != GL_RGBA) {
#if DEBUG_FONT_RENDERER #if DEBUG_FONT_RENDERER
ALOGD("fitBitmap: kARGB32_Format glyph cannot fit into texture format %x", mFormat); ALOGD("fitBitmap: texture format %x is inappropriate for colour glyphs", mFormat);
#endif #endif
return false; return false;
} }