summaryrefslogtreecommitdiffstats
path: root/libs/hwui/GammaFontRenderer.h
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2013-06-25 14:25:17 -0700
committerVictoria Lease <violets@google.com>2013-07-31 15:50:47 -0700
commit1e546815bbb736c50679a8aefc25f48561026fc5 (patch)
tree11a3b7106638c123d052d50ce3e2a1757e004cb4 /libs/hwui/GammaFontRenderer.h
parent3a6f25512c0a682b10961a5a7428e3393ffb0b75 (diff)
downloadframeworks_base-1e546815bbb736c50679a8aefc25f48561026fc5.zip
frameworks_base-1e546815bbb736c50679a8aefc25f48561026fc5.tar.gz
frameworks_base-1e546815bbb736c50679a8aefc25f48561026fc5.tar.bz2
Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)
Quite a few things going on in this commit: - Enable bitmap strikes by default in Paint objects. The SkPaint parameter that enables bitmap strikes was not previously included in DEFAULT_PAINT_FLAGS. This effectively disabled bitmap fonts. Oops! It's for the best, though, as additional work was needed in Skia to make bitmap fonts work anyway. - Complain if TEXTURE_BORDER_SIZE is not 1. Our glyph cache code does not currently handle any value other than 1 here, including zero. I've added a little C preprocessor check to prevent future engineers (including especially future-me) from thinking that they can change this value without updating the related code. - Add GL_RGBA support to hwui's FontRenderer and friends This also happened to involve some refactoring for convenience and cleanliness. Bug: 9577689 Change-Id: I0abd1e5a0d6623106247fb6421787e2c2f2ea19c
Diffstat (limited to 'libs/hwui/GammaFontRenderer.h')
-rw-r--r--libs/hwui/GammaFontRenderer.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/hwui/GammaFontRenderer.h b/libs/hwui/GammaFontRenderer.h
index bbfa66d..46cfd04 100644
--- a/libs/hwui/GammaFontRenderer.h
+++ b/libs/hwui/GammaFontRenderer.h
@@ -35,7 +35,7 @@ public:
virtual FontRenderer& getFontRenderer(const SkPaint* paint) = 0;
virtual uint32_t getFontRendererCount() const = 0;
- virtual uint32_t getFontRendererSize(uint32_t fontRenderer) const = 0;
+ virtual uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const = 0;
virtual void describe(ProgramDescription& description, const SkPaint* paint) const = 0;
virtual void setupProgram(ProgramDescription& description, Program* program) const = 0;
@@ -81,8 +81,8 @@ public:
return 1;
}
- uint32_t getFontRendererSize(uint32_t fontRenderer) const {
- return mRenderer ? mRenderer->getCacheSize() : 0;
+ uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
+ return mRenderer ? mRenderer->getCacheSize(format) : 0;
}
void describe(ProgramDescription& description, const SkPaint* paint) const;
@@ -128,8 +128,8 @@ public:
return 1;
}
- uint32_t getFontRendererSize(uint32_t fontRenderer) const {
- return mRenderer ? mRenderer->getCacheSize() : 0;
+ uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
+ return mRenderer ? mRenderer->getCacheSize(format) : 0;
}
void describe(ProgramDescription& description, const SkPaint* paint) const {
@@ -162,13 +162,13 @@ public:
return kGammaCount;
}
- uint32_t getFontRendererSize(uint32_t fontRenderer) const {
+ uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
if (fontRenderer >= kGammaCount) return 0;
FontRenderer* renderer = mRenderers[fontRenderer];
if (!renderer) return 0;
- return renderer->getCacheSize();
+ return renderer->getCacheSize(format);
}
void describe(ProgramDescription& description, const SkPaint* paint) const {