File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
modules_base/base/src/main/java/com/m4coding/coolhub/base/utils Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 10
10
import android .os .Build ;
11
11
import android .renderscript .Allocation ;
12
12
import android .renderscript .Element ;
13
+ import android .renderscript .RSInvalidStateException ;
13
14
import android .renderscript .RenderScript ;
14
15
import android .renderscript .ScriptIntrinsicBlur ;
15
16
import android .support .annotation .FloatRange ;
@@ -130,6 +131,10 @@ public static Bitmap renderScriptBlur(final Bitmap src,
130
131
blurScript .setRadius (radius );
131
132
blurScript .forEach (output );
132
133
output .copyTo (ret );
134
+ } catch (RSInvalidStateException e ){
135
+ //捕捉异常,避免Bad bitmap type: RGBA_F16 在三星 SM N9600 android9.0出现过
136
+ e .printStackTrace ();
137
+ ret = stackBlur (src , (int ) radius , recycle );
133
138
} finally {
134
139
if (rs != null ) {
135
140
rs .destroy ();
You can’t perform that action at this time.
0 commit comments