PixelCopy for surface, main-thread bugfix, Optimized stack for API-31 instead of renderScript (from other pull-request by KaustubhsPatangnse) #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the new readme:
On API-26 and newer, Blurry uses PixelCopy to copy directly from the surface of the window,
and can thus obtain a bitmap that contains a GoogleMap. Blurry automatically use PixelCopy when using
Blurry.with(activity)
instead of the deprecatedBlurry.with(context)
.Bugfix:
The old code of applied the Blur.of work inside main-thread, which completely negated the intention of the task. I move the blur-job out-side main.
I did some performance tests on the optimized stack (se by branch
performance-test
), executed on Samsung S20 FE, running API-31 = Android-12.The code by KaustubhsPatangnse did not go multi-threaded. I implemented that but then the image contained errors. So the code I have pushed does not use the multi-threaded, but I left the code in, in case someone will fix it. So for the above runtimes we should ignore multithreaded. For singleThreaded its clearly faster than the original stack implementation and slower than RS on this hardware accelerated device. But the hardware acceleration is said to vanish on future devices.