-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for swing interop #737
base: master
Are you sure you want to change the base?
Conversation
API can be improved when more tests will be written. May be you know some other usecases that we can handle in tests? I thought about resizing, but cannot imagine how to write test for such dynamic behaviour |
I would say, we need to check all cases from SkiaLayerTest. They also applicable to SkiaSwingLayer |
Not all, but I agree we can check smth like multiple windows and multiple components. Thank you, will write! |
Resizing needs to be tested for 2 cases:
|
skiko/src/awtTest/kotlin/org/jetbrains/skiko/SkiaSwingLayerTest.kt
Outdated
Show resolved
Hide resolved
skiko/src/awtTest/kotlin/org/jetbrains/skiko/SkiaSwingLayerTest.kt
Outdated
Show resolved
Hide resolved
|
||
private fun fillSkikoView(color: Color = Color.RED): SkikoView = object : SkikoView { | ||
override fun onRender(canvas: Canvas, width: Int, height: Int, nanoTime: Long) { | ||
canvas.drawRect(Rect(0f, 0f, width.toFloat(), height.toFloat()), Paint().apply { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth add a semi-transparent green background around the rect, to check blending (to the Swing rect as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is worth adding it only for swing here. Will do
5fc1b37
to
a9a040e
Compare
I've added test for z-ordering with SkiaSwingLayer. Also, I checked that test fails with heavy-weight SkiaLayer component