Skip to content

Commit 6e6cea1

Browse files
authored
fix(replay): Change bitmap config to ARGB_8888 for screenshots (#4282) (#4283)
* fix(replay): Change bitmap config to ARGB_8888 for screenshots * Changelog
1 parent a72b4b1 commit 6e6cea1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Session Replay: Change bitmap config to `ARGB_8888` for screenshots ([#4282](https://github.com/getsentry/sentry-java/pull/4282))
8+
39
## 7.22.4
410

511
### Fixes

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
@@ -53,13 +53,13 @@ internal class ScreenshotRecorder(
5353
Bitmap.createBitmap(
5454
1,
5555
1,
56-
Bitmap.Config.RGB_565
56+
Bitmap.Config.ARGB_8888
5757
)
5858
}
5959
private val screenshot = Bitmap.createBitmap(
6060
config.recordingWidth,
6161
config.recordingHeight,
62-
Bitmap.Config.RGB_565
62+
Bitmap.Config.ARGB_8888
6363
)
6464
private val singlePixelBitmapCanvas: Canvas by lazy(NONE) { Canvas(singlePixelBitmap) }
6565
private val prescaledMatrix by lazy(NONE) {
@@ -217,7 +217,9 @@ internal class ScreenshotRecorder(
217217
fun close() {
218218
unbind(rootView?.get())
219219
rootView?.clear()
220-
screenshot.recycle()
220+
if (!screenshot.isRecycled) {
221+
screenshot.recycle()
222+
}
221223
isCapturing.set(false)
222224
}
223225

0 commit comments

Comments
 (0)