Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5461] Android: View with border radius crashes Honeycomb when hardware acceleration on

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-01-05T15:22:26.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sSprint 2011-40, Release 1.8.0
ComponentsAndroid
Labelshoneycomb, module_views, qe-testadded, stage
ReporterBill Dawson
AssigneeBill Dawson
Created2011-10-06T14:15:43.000+0000
Updated2012-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)

Comments

  1. Bill Dawson 2011-10-06

    Pull req ready https://github.com/appcelerator/titanium_mobile/pull/534
  2. Natalie Huynh 2011-12-06

    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)
  3. Michael Pettiford 2012-01-05

    Reopening/closing to add/remove labels

JSON Source