-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PixelCopy for surface, main-thread bugfix, Optimized stack for API-31 instead of renderScript (from other pull-request by KaustubhsPatangnse) #120
Open
arberg
wants to merge
16
commits into
wasabeef:main
Choose a base branch
from
arberg:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…vity for API-26+. It can obtain pixels from GoogleMap view and other surfaces. Async-bugfix: Execute bitmap-generation off main-thread, as required by async.
…lback on drawingcache
…failed, for instance because surface not ready. Extracted PixelCopy listener variable, so the try-catch is easier to read.
…sed internally in Blurry and does not live longer than the executing method
…hods are smaller.
I've updated the code today, fixing a bug where the activity surface wasn't ready yet, and also cleaning up the new code a bit. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.