Skip to content

Commit a725971

Browse files
authored
Merge branch 'main' into chore/bump-spring-boot-from-2.7.5-to-2.7.18
2 parents b4488ca + 2521792 commit a725971

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Fixes
1010

1111
- Do not override user-defined `SentryOptions` ([#4262](https://github.com/getsentry/sentry-java/pull/4262))
12+
- Session Replay: Change bitmap config to `ARGB_8888` for screenshots ([#4282](https://github.com/getsentry/sentry-java/pull/4282))
1213

1314
### Dependencies
1415

sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ internal class ScreenshotRecorder(
5252
Bitmap.createBitmap(
5353
1,
5454
1,
55-
Bitmap.Config.RGB_565
55+
Bitmap.Config.ARGB_8888
5656
)
5757
}
5858
private val screenshot = Bitmap.createBitmap(
5959
config.recordingWidth,
6060
config.recordingHeight,
61-
Bitmap.Config.RGB_565
61+
Bitmap.Config.ARGB_8888
6262
)
6363
private val singlePixelBitmapCanvas: Canvas by lazy(NONE) { Canvas(singlePixelBitmap) }
6464
private val prescaledMatrix by lazy(NONE) {
@@ -216,7 +216,9 @@ internal class ScreenshotRecorder(
216216
fun close() {
217217
unbind(rootView?.get())
218218
rootView?.clear()
219-
screenshot.recycle()
219+
if (!screenshot.isRecycled) {
220+
screenshot.recycle()
221+
}
220222
isCapturing.set(false)
221223
}
222224

0 commit comments

Comments
 (0)