mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-15 07:00:51 +00:00
desktop: correct animated image comments
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ private suspend fun playFrames(codec: Codec, blurred: State<Boolean>?, showFrame
|
||||
// busy machine should not turn a cheap animation into a still. Expensive ones overrun every frame.
|
||||
if (System.nanoTime() - startedDecoding > MAX_FRAME_DECODE_MS * 1_000_000) slowFrames++ else slowFrames = 0
|
||||
if (slowFrames >= 2) {
|
||||
Log.d(TAG, "Animation too expensive to decode, keeping the still image")
|
||||
Log.d(TAG, "Animation too expensive to decode, stopping on this frame")
|
||||
return
|
||||
}
|
||||
// A new wrapper around the same raster, so the state sees a change - as the video surface does.
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ actual fun SimpleAndAnimatedImageView(
|
||||
blurred: State<Boolean>,
|
||||
ImageView: @Composable (painter: Painter, onClick: () -> Unit) -> Unit
|
||||
) {
|
||||
// The small view is the chat list preview: a 36dp box that the desktop layout keeps on screen the whole
|
||||
// The small view is the chat list preview: a 36sp box that the desktop layout keeps on screen the whole
|
||||
// time. Decoding an animation at its own resolution to fill it would hold a raster and spend a frame of
|
||||
// work per listed chat, without pause, so it keeps the still image as it did before.
|
||||
val frame = if (smallView) null else rememberAnimatedImage(data, imageBitmap, blurred)
|
||||
|
||||
Reference in New Issue
Block a user