Skip to content
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

Use PixelCopy API when supported #147

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Conversation

mattprecious
Copy link
Owner

This supports hardware rendering.

Fixes #142, but only on API 26+. Not sure if there's anything we can do for earlier versions.

Bitmap screenshot = Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
Window window = findWindow();
if (Build.VERSION.SDK_INT >= 26 && view != this && window != null) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view != this isn't correct. Gotta fix this logic.

@mattprecious mattprecious force-pushed the mattp/2024-11-05/pixelcopy branch from 1011d59 to 0e4fe2f Compare November 11, 2024 19:47
This supports hardware rendering.
@mattprecious mattprecious force-pushed the mattp/2024-11-05/pixelcopy branch from 0e4fe2f to 5fb59f3 Compare November 11, 2024 20:31
@mattprecious mattprecious merged commit dd4600c into main Nov 11, 2024
1 check passed
@mattprecious mattprecious deleted the mattp/2024-11-05/pixelcopy branch November 11, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hardware accelerated compose node crashes canvas capture
1 participant