All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.io.nacular.doodle.drawing.impl.DesktopRenderManagerImpl.kt Maven / Gradle / Ivy

There is a newer version: 0.10.4
Show newest version
package io.nacular.doodle.drawing.impl

import io.nacular.doodle.accessibility.AccessibilityManager
import io.nacular.doodle.core.Internal
import io.nacular.doodle.core.View
import io.nacular.doodle.core.impl.DisplayImpl
import io.nacular.doodle.scheduler.AnimationScheduler
import io.nacular.doodle.theme.InternalThemeManager
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ConcurrentSkipListSet

/** @suppress */
@Internal
internal class DesktopRenderManagerImpl(
        display             : DisplayImpl,
        scheduler           : AnimationScheduler,
        themeManager        : InternalThemeManager?,
        accessibilityManager: AccessibilityManager?
): RenderManagerImpl(
    display,
    scheduler,
    themeManager,
    accessibilityManager,
    display.device
) {
    override val views              : MutableSet                   = ConcurrentHashMap.newKeySet()
    override val dirtyViews         : MutableSet                   = ConcurrentHashMap.newKeySet()
    override val displayTree        : MutableMap = ConcurrentHashMap()
    override val neverRendered      : MutableSet                   = ConcurrentHashMap.newKeySet()
    override val pendingLayout      : MutableSet                   = ConcurrentSkipListSet(AncestorComparator)
    override val pendingRender      : MutableSet                   = ConcurrentHashMap.newKeySet() // FIXME: Sort by insertion order
    override val pendingCleanup     : MutableMap> = ConcurrentHashMap()
    override val addedInvisible     : MutableSet                   = ConcurrentHashMap.newKeySet()
    override val visibilityChanged  : MutableSet                   = ConcurrentHashMap.newKeySet()
    override val pendingBoundsChange: MutableSet                   = ConcurrentHashMap.newKeySet()

    override fun addToCleanupList(parent: View, child: View) {
        pendingCleanup.getOrPut(parent) { ConcurrentHashMap.newKeySet() }.apply { add(child) }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy