From 9b949fce39f0f39ce9275b71d7c347210775e7a8 Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Thu, 24 Jun 2010 17:15:34 -0700 Subject: Adding freetype font rendering to renderscript. Change-Id: I3a10ffe27092a41df156341c9cb3f7aa19c49f19 --- libs/rs/rsScriptC_LibGL.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'libs/rs/rsScriptC_LibGL.cpp') diff --git a/libs/rs/rsScriptC_LibGL.cpp b/libs/rs/rsScriptC_LibGL.cpp index 052e14471c3f..dbd398e34c42 100644 --- a/libs/rs/rsScriptC_LibGL.cpp +++ b/libs/rs/rsScriptC_LibGL.cpp @@ -309,6 +309,24 @@ static uint32_t SC_getHeight() return rsc->getHeight(); } +static void SC_DrawTextAlloc(RsAllocation va, int x, int y) +{ + GET_TLS(); + Allocation *alloc = static_cast(va); + rsc->mStateFont.renderText(alloc, x, y); +} + +static void SC_DrawText(const char *text, int x, int y) +{ + GET_TLS(); + rsc->mStateFont.renderText(text, x, y); +} + +static void SC_BindFont(RsFont font) +{ + GET_TLS(); + rsi_ContextBindFont(rsc, font); +} ////////////////////////////////////////////////////////////////////////////// // Class implementation @@ -360,6 +378,11 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "rsgClearColor", (void *)&SC_ClearColor }, { "rsgClearDepth", (void *)&SC_ClearDepth }, + { "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText }, + { "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc }, + + { "rsgBindFont", (void *)&SC_BindFont }, + ////////////////////////////////////// // IO -- cgit v1.2.3