summaryrefslogtreecommitdiff
path: root/libs/rs/rsScriptC_LibGL.cpp
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-06-25 09:24:19 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-06-25 09:24:19 -0700
commit5b7e333cf2f91c94e37dbb7024fa38da3db34619 (patch)
treedeeda2cde4fc739586fbb27956d472a419849f80 /libs/rs/rsScriptC_LibGL.cpp
parentc086d9403f08d4f7505eff4dfdd61e0f22d26abf (diff)
parent9b949fce39f0f39ce9275b71d7c347210775e7a8 (diff)
Merge "Adding freetype font rendering to renderscript."
Diffstat (limited to 'libs/rs/rsScriptC_LibGL.cpp')
-rw-r--r--libs/rs/rsScriptC_LibGL.cpp23
1 files changed, 23 insertions, 0 deletions
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<Allocation *>(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