Fix captureToBitmap for DecorView's.
Fix captureToBitmap for DecorView's.

Previously `withView(isRoot()).captureToBitmap()` would silently
fallback to a less accurate View.draw based capture, because the View's window
could not be found.

Add a workaround for this case, and change the logic so it throws if
the View's window cannot be found.

PiperOrigin-RevId: 481819171

android/android-test,android/android-test,android/android-test,android/android-test,android/android-test