summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsScriptC_Lib.cpp
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-01-14 15:58:37 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-01-14 15:58:37 -0800
commitb3699b14be3a3db1d75ea4c38853b0a53d14b1be (patch)
tree06c2fc15a58278496fa250d3f0d16af24df1c193 /libs/rs/rsScriptC_Lib.cpp
parent7cc57ff22d23daa62e07e0f3d28010d75ed19eea (diff)
parent836e16666ec31dfe7559bcbe5710a97700c383f9 (diff)
downloadframeworks_base-b3699b14be3a3db1d75ea4c38853b0a53d14b1be.zip
frameworks_base-b3699b14be3a3db1d75ea4c38853b0a53d14b1be.tar.gz
frameworks_base-b3699b14be3a3db1d75ea4c38853b0a53d14b1be.tar.bz2
am 836e1666: Merge "add drawSpriteScreenspaceCropped to renderscript" into eclair
Merge commit '836e16666ec31dfe7559bcbe5710a97700c383f9' into eclair-plus-aosp * commit '836e16666ec31dfe7559bcbe5710a97700c383f9': add drawSpriteScreenspaceCropped to renderscript
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r--libs/rs/rsScriptC_Lib.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp
index 23888ff..de8df39 100644
--- a/libs/rs/rsScriptC_Lib.cpp
+++ b/libs/rs/rsScriptC_Lib.cpp
@@ -776,6 +776,17 @@ static void SC_drawSpriteScreenspace(float x, float y, float z, float w, float h
glDrawTexfOES(x, y, z, w, h);
}
+static void SC_drawSpriteScreenspaceCropped(float x, float y, float z, float w, float h,
+ float cx0, float cy0, float cx1, float cy1)
+{
+ GET_TLS();
+ rsc->setupCheck();
+
+ GLint crop[4] = {cx0, cy0, cx1, cy1};
+ glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
+ glDrawTexfOES(x, y, z, w, h);
+}
+
static void SC_drawSprite(float x, float y, float z, float w, float h)
{
GET_TLS();
@@ -1271,6 +1282,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = {
"void", "(float x, float y, float z, float w, float h)" },
{ "drawSpriteScreenspace", (void *)&SC_drawSpriteScreenspace,
"void", "(float x, float y, float z, float w, float h)" },
+ { "drawSpriteScreenspaceCropped", (void *)&SC_drawSpriteScreenspaceCropped,
+ "void", "(float x, float y, float z, float w, float h, float cx0, float cy0, float cx1, float cy1)" },
{ "drawLine", (void *)&SC_drawLine,
"void", "(float x1, float y1, float z1, float x2, float y2, float z2)" },
{ "drawPoint", (void *)&SC_drawPoint,