Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,13 @@ public static Bitmap ToBlurred(Bitmap source, Context context, float radius)
script.ForEach(outAlloc);
outAlloc.CopyTo(output);

// NOTE: Xamarin.Android Dispose() doesn't call 'destroy' on the allocations or scripts. Therefore, we must manually call it.
outAlloc.Destroy();
inAlloc.Destroy();
script.Destroy();
rs.Destroy();
return output;
}

//Bitmap output = Bitmap.createBitmap(smallBitmap.getWidth(), smallBitmap.getHeight(), smallBitmap.getConfig());

//RenderScript rs = RenderScript.create(getContext());
//ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
//Allocation inAlloc = Allocation.createFromBitmap(rs, smallBitmap, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_GRAPHICS_TEXTURE);
//Allocation outAlloc = Allocation.createFromBitmap(rs, output);
//script.setRadius(BLUR_RADIUS);
//script.setInput(inAlloc);
//script.forEach(outAlloc);
//outAlloc.copyTo(output);

//rs.destroy();
}

return ToLegacyBlurred(source, context, (int)radius);
Expand Down