David Silber
02/06/2022, 2:06 AMBrian G
02/06/2022, 3:31 AMText
function, I made the human sprite in Aseprite. And yes, there are hats.Jan
02/06/2022, 12:27 PMimplementation(compose.web.core)
implementation(compose.runtime)
implementation(compose.material)
implementation(compose.materialIconsExtended)
Fureeish
02/06/2022, 8:50 PMSKIKO_RENDER_API
, IntelliJ, while building Compose projects, prompts me with an error regarding my hardware. To be exact, I am greeted with the following output:
Failed to create DirectX12 device.
Graphics card NVIDIA GeForce GTX 960M is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Graphics card NVIDIA GeForce GTX 960M is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Graphics card Intel(R) HD Graphics 530 is not supported.
Which I do not understand. I have done some reserach regarding hardware acceleration and that's where I found the information regarding SKIKO_RENDER_API
.
What's more, when the project built and ran, the sample windows is being shown, but all texts are blurry. I am attaching a screenshot below.
If I define the environmental variable in question, the warnings go away, but unless its value is set to SOFTWARE
, the blur persists.
I have deployed an executable using gradle createDistributable
and asked a couple of my friends to run some tests. In every single instance the resulting application was flawless, i.e., there was no blurry text.
None of my friends is using my exact setup, though. Different CPUs and different GPUs. Because of that I suspect that the culprit may as well be my hardware. Is GTX 960M officially not supported by Compose / Skiko? Where can I read about the supported hardware?
I am also curious about the DirectX12 error. I have it installed (the 12 edition). Did anyone encounter similar error? It may be good to add that when working with Android Studio, the whole emulator is blurry too. Regardless of the aforementioned environmental variable.
I could just stick with SKIKO_RENDER_API = "SOFTWARE"
but in the official JetBrains blog I read that:
For testing and benchmarking purposes, you can also explicitly force your application to use the specific renderer of your choice by setting the corresponding environment variable:And, well, I don't really want my app to suffer from performance penalties, even for testing. Apologies if I misused this channel in terms of things that should and should not be posted here. Any pointers will be highly appreciated.orSKIKO_RENDER_API="SOFTWARE"
. However, please keep in mind that this fallback renderer is significantly slower than its hardware-accelerated counterpart (up to 4 times slower)."OPENGL"
mikehearn
02/06/2022, 9:30 PMSrSouza
02/06/2022, 11:27 PMpajatopmr
02/07/2022, 3:42 AMtherealbluepandabear
02/07/2022, 6:54 AMTunji Dahunsi
02/07/2022, 8:47 AMGrégory Lureau
02/07/2022, 4:58 PM./gradlew package
). I'm using a MAC M1.
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class foo.bar.MyClass cannot be cast to class ....
interface Animal { fun foo() }
interface Mammal : Animal
class Tiger : Mammal { ... }
It crashes when I call foo()
on my Tiger instance.
If I check with is
, for some reasons Tiger is Animal
on IDE and Tiger is NOT Animal
once the app is packaged. (And Tiger is Mammal in both usage 🤷 )
Any idea what's going on?Humphrey
02/07/2022, 5:51 PMval skijaArtifact = "skija-linux"
val skijaVersion = "0.93.1"
dependencies {
implementation(compose.desktop.currentOs)
api ("org.jetbrains.skija:${skijaArtifact}:${skijaVersion}")
}
I'm using the following version of compose:
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.0.1-rc2"
}
Enrico Saggiorato
02/07/2022, 6:10 PMSpikey Sanju
02/07/2022, 10:19 PMJohn Aoussou
02/08/2022, 1:43 AMKirill Grouchnikov
02/08/2022, 1:49 PMTextStyle
such as fontFamily
, fontStyle
, fontWeight
, fontSize
) to Skiko's Typeface
or Font
. Is there any public function or class that provides that bridge? There's some code in here for example that looks interesting, but it's all either internal or works with local font resources.Spikey Sanju
02/08/2022, 10:16 PMKirill Grouchnikov
02/10/2022, 5:57 PMMario Javier Medina Cocom
02/10/2022, 6:14 PMluen
02/11/2022, 5:17 PMCody Mikol
02/12/2022, 3:17 AMluen
02/12/2022, 7:41 AM@Composable
fun App() {
val videoUrl by remember { mutableStateOf("<videoUrl>") }
var imageBitmap by remember { mutableStateOf<ImageBitmap?>(null) }
LaunchedEffect(Unit) {
val pFormatContext = avformat_alloc_context()
avformat_open_input(pFormatContext, videoUrl, null, null)
avformat_find_stream_info(pFormatContext, null as PointerPointer<*>?)
var pCodecParameters = AVCodecParameters(null)
for (i in 0 until pFormatContext.nb_streams()) {
val pLocalCodecParameters = pFormatContext.streams(i).codecpar()
if(pLocalCodecParameters.codec_type() == avutil.AVMEDIA_TYPE_VIDEO) {
pCodecParameters = pLocalCodecParameters
}
}
val pCodec = avcodec_find_decoder(pCodecParameters.codec_id())
val pCodecContext = avcodec_alloc_context3(pCodec)
avcodec_parameters_to_context(pCodecContext, pCodecParameters)
avcodec_open2(pCodecContext, pCodec, null as PointerPointer<*>?)
val pPacket = av_packet_alloc()
val pFrame = avutil.av_frame_alloc()
while(av_read_frame(pFormatContext, pPacket) >= 0) {
avcodec_send_packet(pCodecContext, pPacket)
avcodec_receive_frame(pCodecContext, pFrame)
val buff = pPacket.data().position(0).capacity(pPacket.size().toLong()).asByteBuffer()
val arr = byteArrayOf(buff.remaining().toByte())
buff.get(arr)
imageBitmap = Image.makeFromEncoded(arr).toComposeImageBitmap()
delay(500)
}
}
MaterialTheme {
imageBitmap?.let {
Image(
bitmap = it,
contentDescription = "Video"
)
}
}
}
pajatopmr
02/12/2022, 12:54 PM// don't inline, surface controls canvas life time
private val surface = Surface.makeRasterN32Premul(100, 100)
private val canvas = surface.canvas
What's this code doing in terms of facilitating JVM Compose testing?dkim
02/12/2022, 9:38 PMapplication {
Window(
onCloseRequest = ::exitApplication,
title = "App",
onKeyEvent = {
println("keyTyped: ${it.key.nativeKeyCode}:${it.key.nativeKeyCode.toChar()}")
false
}
) {
// Window stuff
}
}
Logs:
keyTyped: 65:A
keyTyped: 0:
keyTyped: 65:A
Using keyCode
instead would just give this output (pressing a):
keyTyped: 279709745152:
keyTyped: 536870912:
keyTyped: 279709745152:
Enrico Saggiorato
02/13/2022, 9:25 AMval doneSteps by remember { mutableStateOf(/* my logic for boolean value */ }
doneSteps.forEach {
// If i try to put AnimatedVisibility here I get the error
}
What is the right approach?pajatopmr
02/13/2022, 10:50 AMdkim
02/13/2022, 1:58 PMCody Mikol
02/13/2022, 11:13 PMSebastian Kürten
02/14/2022, 8:20 AMSpikey Sanju
02/14/2022, 12:23 PManimate
the window size
or skew direction
of window to z-index
?Michael Paus
02/14/2022, 12:50 PMval densityDpi = LocalContext.current.resources.displayMetrics.densityDpi
This only seems to work on Android or maybe I am just blind and don’t see the obvious.Michael Paus
02/14/2022, 12:50 PMval densityDpi = LocalContext.current.resources.displayMetrics.densityDpi
This only seems to work on Android or maybe I am just blind and don’t see the obvious.Sebastian Kürten
02/14/2022, 1:03 PMval density = LocalDensity.current
help?ishitatsuyuki
02/14/2022, 1:04 PMLocalDensity
should be good enough to get that value in an application.Michael Paus
02/14/2022, 2:22 PMval scaledDpi = Toolkit.getDefaultToolkit().screenResolution
val displayScalingFactor = LocalDensity.current.density.dp.value
val physicalDpi = displayScalingFactor * scaledDpi
I think the underlying issue is this: https://github.com/JetBrains/compose-jb/issues/531