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

Add SHIFT6m to hardware bitmap blocklist #1812

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

johan12345
Copy link
Contributor

I received the following stacktrace from a user with a SHIFT6m device running Android 8.1 (API 27). This is not in a shared element transition.

java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps
	at android.graphics.BaseCanvas.throwIfHwBitmapInSwMode(BaseCanvas.java:532)
	at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:62)
	at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:120)
	at android.graphics.Canvas.drawBitmap(Canvas.java:1434)
	at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
	at android.widget.ImageView.onDraw(ImageView.java:1349)
	at android.view.View.draw(View.java:19315)
	at android.view.View.draw(View.java:19179)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4297)
	at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5499)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4083)
	at android.view.View.draw(View.java:19323)
	at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4898)
	at android.view.View.draw(View.java:19179)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4297)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4083)
	at android.view.View.draw(View.java:19323)
	at androidx.transition.TransitionUtils.createViewBitmap(TransitionUtils.java:133)
	at androidx.transition.TransitionUtils.copyViewImage(TransitionUtils.java:64)
	at androidx.transition.Visibility.onDisappear(Visibility.java:404)
	at androidx.transition.Visibility.createAnimator(Visibility.java:257)
	at androidx.transition.Transition.createAnimators(Transition.java:744)
	at androidx.transition.TransitionSet.createAnimators(TransitionSet.java:480)
	at androidx.transition.TransitionSet.createAnimators(TransitionSet.java:480)
	at androidx.transition.Transition.playTransition(Transition.java:1808)
	at androidx.transition.TransitionManager$MultiListener.onPreDraw(TransitionManager.java:300)
	at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2451)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1443)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7011)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:916)
	at android.view.Choreographer.doCallbacks(Choreographer.java:728)
	at android.view.Choreographer.doFrame(Choreographer.java:660)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:902)
	at android.os.Handler.handleCallback(Handler.java:790)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6548)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)

@colinrtwhite
Copy link
Member

Are you sure this isn't a shared element transition? It looks like the stacktrace calls androidx.transition.TransitionUtils.createViewBitmap(TransitionUtils.java:133), which will fail on API 27 due to requiring a software bitmap.

Just to confirm: the crash is only occurring for users with that device model? There are no reports for other devices?

@johan12345
Copy link
Contributor Author

It is a transition implemented by the StfalconImageViewer library, but as far as I can see It's just using transitions within a view using TransitionManager for that, not the shared element transition API (i.e. between different fragments/activities, using addSharedElement).

It's the first report about this crash that I've received so far, and the code has been unchanged since a release on 1 April this year... I also couldn't reproduce it on an API 27 emulator.

@colinrtwhite
Copy link
Member

@johan12345 Gotcha, given this device fits the pattern of devices that could have this problem and disabling hardware bitmaps for this device is low risk (it's at most a minor perf hit), let's merge this in.

@colinrtwhite colinrtwhite merged commit 4ffb10b into coil-kt:main Jul 18, 2023
colinrtwhite added a commit that referenced this pull request Jul 25, 2023
* main:
  Bump roborazzi from 1.2.0 to 1.3.0 (#1822)
  Bump app.cash.paparazzi:paparazzi-gradle-plugin from 1.3.0 to 1.3.1 (#1819)
  Bump com.diffplug.spotless from 6.19.0 to 6.20.0 (#1817)
  Add SHIFT6m to hardware bitmap blocklist (#1812)
  Bump okio from 3.3.0 to 3.4.0 (#1806)
  Fix incorrect link to OkHttpClient.newBuilder (#1803)
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.

2 participants