Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-5461

Android: View with border radius crashes Honeycomb when hardware acceleration on

    Details

      Description

      Honeycomb introduced hardware acceleration which can be turned on with a setting in the <application> 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 <android> section so:

      tiapp.xml

      	<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:

      app.js

      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)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                billdawson Bill Dawson
                Reporter:
                billdawson Bill Dawson
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-4625
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code