Fix point sprites.

Change-Id: Ic9438daaf25f3969a0dd5b634b7cceccbbbfb27b
diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp
index 0adce75..6cf64a4 100644
--- a/libs/rs/rsProgramFragment.cpp
+++ b/libs/rs/rsProgramFragment.cpp
@@ -56,6 +56,11 @@
 
         glEnable(GL_TEXTURE_2D);
         if (rsc->checkVersion1_1()) {
+            if (mPointSpriteEnable) {
+                glEnable(GL_POINT_SPRITE_OES);
+            } else {
+                glDisable(GL_POINT_SPRITE_OES);
+            }
             glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable);
         }
         glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID());
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp
index 5b19f17..d10076b 100644
--- a/libs/rs/rsScriptC_Lib.cpp
+++ b/libs/rs/rsScriptC_Lib.cpp
@@ -800,6 +800,12 @@
     glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, s);
 }
 
+static void SC_pointAttenuation(float a, float b, float c)
+{
+    GLfloat params[] = { a, b, c };
+    glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, params);
+}
+
 static void SC_hsbToRgb(float h, float s, float b, float* rgb)
 {
     float red = 0.0f;
@@ -1185,6 +1191,8 @@
         "void", "(float, float, float, float)" },
     { "shininess", (void *)&SC_shininess,
         "void", "(float)" },
+    { "pointAttenuation", (void *)&SC_pointAttenuation,
+        "void", "(float, float, float)" },
 
     { "uploadToTexture", (void *)&SC_uploadToTexture,
         "void", "(int, int)" },