Skip to content

Commit 1f7f696

Browse files
authored
Merge pull request #194 from kdroidFilter/fix/video-alpha-blending-issue-98
fix: use BlendMode.Src for video frame rendering
2 parents f2fe9c6 + 7a0e8d3 commit 1f7f696

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

mediaplayer/src/commonMain/kotlin/io/github/kdroidfilter/composemediaplayer/util/ContentScaleCanvasUtils.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package io.github.kdroidfilter.composemediaplayer.util
33
import androidx.compose.foundation.layout.*
44
import androidx.compose.runtime.Composable
55
import androidx.compose.ui.Modifier
6+
import androidx.compose.ui.graphics.BlendMode
67
import androidx.compose.ui.graphics.ImageBitmap
78
import androidx.compose.ui.graphics.drawscope.DrawScope
89
import androidx.compose.ui.layout.ContentScale
@@ -98,7 +99,8 @@ internal fun DrawScope.drawScaledImage(
9899
image = image,
99100
srcOffset = IntOffset(srcX, srcY),
100101
srcSize = IntSize(srcW, srcH),
101-
dstSize = dstSize, // draw into full destination rect
102+
dstSize = dstSize,
103+
blendMode = BlendMode.Src,
102104
)
103105
} else {
104106
/* --------------------------------------------------------------
@@ -109,6 +111,7 @@ internal fun DrawScope.drawScaledImage(
109111
drawImage(
110112
image = image,
111113
dstSize = dstSize,
114+
blendMode = BlendMode.Src,
112115
)
113116
}
114117
}

0 commit comments

Comments
 (0)