louiscad
12/16/2023, 3:09 PMyschimke
12/16/2023, 10:26 PMYingding Wang
12/23/2023, 12:59 AMYingding Wang
12/23/2023, 1:01 AMyschimke
12/23/2023, 9:28 AMyschimke
12/23/2023, 9:30 AMyschimke
12/23/2023, 9:31 AMyschimke
12/23/2023, 9:31 AMyschimke
12/23/2023, 9:32 AMinternal fun imageResource() = canvasToImageResource(Size(100f, 100f), Density(context)) {
// draw operations here
}
Yingding Wang
12/23/2023, 10:35 AMyschimke
12/23/2023, 10:35 AMyschimke
12/23/2023, 10:36 AMyschimke
12/23/2023, 10:37 AMyschimke
12/23/2023, 10:37 AMYingding Wang
12/23/2023, 10:42 AMlouiscad
12/23/2023, 11:15 AMAustin Nelson
01/17/2024, 4:30 PMlouiscad
01/17/2024, 4:30 PMlouiscad
01/17/2024, 4:31 PMAustin Nelson
01/17/2024, 4:32 PMlouiscad
01/17/2024, 4:47 PMlouiscad
01/17/2024, 4:48 PMlouiscad
02/23/2024, 11:35 AMLukáš Kúšik
02/23/2024, 3:08 PMlouiscad
02/23/2024, 3:09 PMyschimke
02/23/2024, 3:13 PMlouiscad
02/23/2024, 3:14 PMLukáš Kúšik
02/23/2024, 3:14 PMRenderer.GlesRenderer2
and creating a bitmap texture there that would be the target for Compose rendering...louiscad
02/23/2024, 3:15 PMBrush
?Lukáš Kúšik
02/23/2024, 3:16 PMCanvas
with this approach, however, text drawing etc. in Canvas is limited. Arbitrary Compose to Bitmap would be a lot better, but I haven't looked much if it is possible to rasterize Compose like that.yschimke
02/23/2024, 3:18 PMlouiscad
02/23/2024, 3:18 PMyschimke
02/23/2024, 3:18 PMlouiscad
02/23/2024, 3:19 PMyschimke
02/23/2024, 3:20 PMyschimke
02/23/2024, 3:20 PMlouiscad
02/23/2024, 3:20 PMLukáš Kúšik
02/23/2024, 3:21 PMlouiscad
02/23/2024, 3:22 PMlouiscad
02/23/2024, 3:22 PMlouiscad
02/23/2024, 3:23 PMLukáš Kúšik
02/23/2024, 3:24 PMAlex Vanyo
02/23/2024, 6:03 PMGlesRenderer2
and using the Compose snapshot state system to drive the state management for what I render in OpenGL in the watchface. Which definitely isn't quite the same as using Compose's UI library to drive the pixels on a watchface.yschimke
02/23/2024, 6:08 PMAlex Vanyo
02/23/2024, 7:05 PMCanvas
into GlesRenderer2
already for rendering complications: https://github.com/alexvanyo/composelife/blob/562e40704ea74c724eb0d694d836c7a43b2c[…]n/com/alexvanyo/composelife/wear/watchface/ComplicationShape.kt
So if you can get the Compose UI rendering into a Canvas
, you can render it as a texture into OpenGL with a bit of workyschimke
02/25/2024, 1:43 PMyschimke
02/25/2024, 1:43 PMGLES20.glDrawElements(
GLES20.GL_TRIANGLES,
drawOrder.size,
GLES20.GL_UNSIGNED_SHORT,
drawListBuffer,
)
Alex Vanyo
02/25/2024, 10:54 PMRenderer.GlesRenderer2.render
yep, you can call into GLES to draw thingsyschimke
02/26/2024, 6:23 AM