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
fix(android): fix views with border and transparency #11224
Conversation
Properly handle disabling the HW acceleration for views with transparency and borders
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: PASS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FR Passed: Views with borderRadius now show up semi-transparent. Tested with the test case in the description and additional tests from the mentioned PRs above were done.
Test Environment
MacOS Catalina 10.15 Beta
Node.js ^8.11.1
Android Pixel XL 7.1 Emulator
"NPM":"4.2.15","CLI":"7.1.1"
Java Version 1.8.0_131
Android NDK: 12.1.2977051
Either this one or #10637 is causing a regression with Ti.Map which now displays an empty map, after updating to latest master. You can try with our internal project, I think both @garymathews and @jquick-axway have access to it. |
@hansemannn, we'll check it out. Thanks. |
Okay, I've confirmed that we have a regression on "master". If you apply a border to a var window = Ti.UI.createWindow({ fullscreen: true });
var videoView = Ti.Media.createVideoPlayer({
url: "http://assets.appcelerator.com.s3.amazonaws.com/video/media.m4v",
autoplay: true,
borderWidth: "4dp",
borderColor: "red",
width: Ti.UI.FILL,
height: Ti.UI.FILL,
});
window.add(videoView);
window.open(); I've written up a private ticket for it here: TIMOB-27444 |
The fix for the regression can be found here: It turns out the old code (before this PR) was wrongly "trying" to disabling hardware acceleration when it didn't need to, but failing due to what this PR was fixing. So, this PR merely brought the pre-existing bug to the surface. |
Thanks Josh, that was fast! |
JIRA: https://jira.appcelerator.org/browse/TIMOB-26394
Description:
Rework handling the disabling of the HW acceleration for views with transparency and borders.
isHardwareAccelerated()
returns whether the view is attached to a Window with enabled HW acceleration:https://android.googlesource.com/platform/frameworks/base.git/+/refs/heads/master/core/java/android/view/View.java#20915
So it depends on the view being attached to a Window. Our call of
disableHWAcceleration()
in TiUIView.java happens before the native view is actually attached to a window, so it would require an additional check in order to determine when to disable acceleration for the TiBorderWrapperView. CurrentlyborderView.isHardwareAccelerated()
will always return false, resulting in skipping our method.We had a change in 6.3.0.GA for this code in this PR:
#9410
Ran the test cases from it and it works fine both on Android 19 and Android 29.
This PR also fixes the case described in this JIRA ticket - https://jira.appcelerator.org/browse/TIMOB-26291
During FR I would recommend trying the test cases from all three PRs to avoid regressions.
Note: No unit test, since this is a visual fix.
Test case:
app.js