Revert "Revert "Use RenderScript for large text blurs""

This reverts commit bf5703e52e3304246cbf0e73f6976f7d7312d238.

Change-Id: Ic6f991277dec9e80a6fed93db91499726b30ab2a
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index 3964bca..d0c44ef 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -31,6 +31,12 @@
 #include "Matrix.h"
 #include "Properties.h"
 
+namespace RSC {
+    class Element;
+    class RS;
+    class ScriptIntrinsicBlur;
+}
+
 namespace android {
 namespace uirenderer {
 
@@ -178,13 +184,19 @@
     Vector<uint32_t> mDrawCounts;
     Vector<CacheTexture*> mDrawCacheTextures;
 
-    /** We should consider multi-threading this code or using Renderscript **/
+    // RS constructs
+    sp<RSC::RS> mRs;
+    sp<const RSC::Element> mRsElement;
+    sp<RSC::ScriptIntrinsicBlur> mRsScript;
+
     static void computeGaussianWeights(float* weights, int32_t radius);
     static void horizontalBlur(float* weights, int32_t radius, const uint8_t *source, uint8_t *dest,
             int32_t width, int32_t height);
     static void verticalBlur(float* weights, int32_t radius, const uint8_t *source, uint8_t *dest,
             int32_t width, int32_t height);
-    static void blurImage(uint8_t* image, int32_t width, int32_t height, int32_t radius);
+
+    // the input image handle may have its pointer replaced (to avoid copies)
+    void blurImage(uint8_t** image, int32_t width, int32_t height, int32_t radius);
 };
 
 }; // namespace uirenderer