[TIMOB-5461] Android: View with border radius crashes Honeycomb when hardware acceleration on
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-05T15:22:26.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | Sprint 2011-40, Release 1.8.0 |
Components | Android |
Labels | honeycomb, module_views, qe-testadded, stage |
Reporter | Bill Dawson |
Assignee | Bill Dawson |
Created | 2011-10-06T14:15:43.000+0000 |
Updated | 2012-11-19T18:44:31.000+0000 |
Description
Honeycomb introduced hardware acceleration which can be turned on with a setting in the node of AndroidManifest.xml. When it's turned on, and a view has a borderRadius set (> 0), the app crashes because we use clipPath, which is not supported with hw accel. (cf http://android-developers.blogspot.com/2011/03/android-30-hardware-acceleration.html).
Re-creation steps:
* Create an app.
* Make the tiapp.xml's section so:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>11</tool-api-level>
<manifest>
<application android:hardwareAccelerated="true"/>
</manifest>
</android>
* Make the app.js so:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Test',
backgroundColor:'#000',
exitOnClose: true
});
win.add(Ti.UI.createView({
backgroundColor: "blue",
borderColor: "red",
borderWidth: 10,
borderRadius: 5,
left: "10dp",
right: "10dp",
top: "50dp",
height: "200dp"
}));
win.open();
* Run the app on the honeycomb device and it will crash. (When testing the fix, it should not crash of course.).
Typical crash logcat entry looks like:
E/AndroidRuntime(26499): java.lang.UnsupportedOperationException
E/AndroidRuntime(26499): at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287)
E/AndroidRuntime(26499): at org.appcelerator.titanium.view.TiBackgroundDrawable.draw(TiBackgroundDrawable.java:73)
E/AndroidRuntime(26499): at android.view.View.draw(View.java:9264)
... (etc)
Pull req ready https://github.com/appcelerator/titanium_mobile/pull/534
Tested with 1.8.0.1.v20111205164258 v8/rhino on Galaxy 10.1 (3.1) Droid 1 (2.2.2) Nexus S (2.3.6) Emulator (4.0)
Reopening/closing to add/remove labels