summaryrefslogtreecommitdiff
path: root/libs/hwui/FontRenderer.h
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2012-11-14 16:11:10 -0800
committer Chris Craik <ccraik@google.com> 2013-02-12 17:45:28 -0800
commit3f76e65d251ead65fe8ff98e3bd4c7623fbaac07 (patch)
treeb8dfc636012f670aba6a348340ae12770ab63372 /libs/hwui/FontRenderer.h
parentd04892d207d50378356feef181ac4e4eff9652d7 (diff)
Use RenderScript for large text blurs
Still fall back to simple path for small tasks Change-Id: I492f1b3f7d6fec1738f3e45cbfb15864bd23a392
Diffstat (limited to 'libs/hwui/FontRenderer.h')
-rw-r--r--libs/hwui/FontRenderer.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index 3964bca90646..d0c44ef5b982 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 @@ private:
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