Skip to content

Commit b764025

Browse files
committed
Undo remove one allocation of Rect because it is inevitable
1 parent 014c569 commit b764025

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/scene/WindowComposeSceneLayer.desktop.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ import androidx.compose.ui.platform.PlatformWindowContext
2929
import androidx.compose.ui.scene.skia.SkiaLayerComponent
3030
import androidx.compose.ui.skiko.OverlayRenderDecorator
3131
import androidx.compose.ui.unit.Density
32-
import androidx.compose.ui.unit.IntRect
3332
import androidx.compose.ui.unit.LayoutDirection
3433
import androidx.compose.ui.unit.roundToIntRect
3534
import androidx.compose.ui.unit.toOffset
36-
import androidx.compose.ui.util.fastRoundToInt
3735
import androidx.compose.ui.window.density
3836
import androidx.compose.ui.window.getDialogScrimBlendMode
3937
import androidx.compose.ui.window.layoutDirectionFor
@@ -115,12 +113,8 @@ internal class WindowComposeSceneLayer(
115113
override var scrimColor: Color? = null
116114

117115
init {
118-
drawBounds = IntRect(
119-
0,
120-
0,
121-
windowContainer.sizeInPx.width.fastRoundToInt(),
122-
windowContainer.sizeInPx.height.fastRoundToInt()
123-
)
116+
val boundsInPx = windowContainer.sizeInPx.toRect()
117+
drawBounds = boundsInPx.roundToIntRect()
124118
mediator = ComposeSceneMediator(
125119
container = container,
126120
isWindowLevel = true,

0 commit comments

Comments
 (0)