diff options
| author | 2012-11-14 16:11:10 -0800 | |
|---|---|---|
| committer | 2013-02-12 17:45:28 -0800 | |
| commit | 3f76e65d251ead65fe8ff98e3bd4c7623fbaac07 (patch) | |
| tree | b8dfc636012f670aba6a348340ae12770ab63372 /libs/hwui/FontRenderer.h | |
| parent | d04892d207d50378356feef181ac4e4eff9652d7 (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.h | 16 |
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 |