| 30 | #endif /* KRITA_USE_SURFACE_COLOR_MANAGEMENT_API */ |
| 31 | |
| 32 | KisMultiSurfaceStateManager::State KisMultiSurfaceStateManager::createInitializingConfig(bool isCanvasOpenGL, int screenId, KisProofingConfigurationSP proofingConfig) const |
| 33 | { |
| 34 | State state; |
| 35 | KisMultiSurfaceDisplayConfig &multiConfig = state.multiConfig; |
| 36 | |
| 37 | state.isCanvasOpenGL = isCanvasOpenGL; |
| 38 | |
| 39 | KisConfig cfg(true); |
| 40 | |
| 41 | state.optionsFromConfig = KisDisplayConfig::optionsFromKisConfig(cfg); |
| 42 | state.surfaceMode = cfg.canvasSurfaceColorSpaceManagementMode(); |
| 43 | state.proofingConfig = proofingConfig; |
| 44 | |
| 45 | if (KisOpenGLModeProber::instance()->useHDRMode()) { |
| 46 | multiConfig.canvasProfile = state.isCanvasOpenGL |
| 47 | ? KisOpenGLModeProber::instance()->rootSurfaceColorProfile() |
| 48 | : KoColorSpaceRegistry::instance()->p709SRGBProfile(); |
| 49 | multiConfig.uiProfile = KoColorSpaceRegistry::instance()->p709SRGBProfile(); |
| 50 | |
| 51 | } else if (KisPlatformPluginInterfaceFactory::instance()->surfaceColorManagedByOS()) { |
| 52 | #if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API |
| 53 | KIS_SAFE_ASSERT_RECOVER_NOOP(m_rootSurfaceInfoProxy); |
| 54 | if (m_rootSurfaceInfoProxy) { |
| 55 | multiConfig.canvasProfile = m_rootSurfaceInfoProxy->rootSurfaceProfile(); |
| 56 | multiConfig.uiProfile = m_rootSurfaceInfoProxy->rootSurfaceProfile(); |
| 57 | } |
| 58 | #else |
| 59 | KIS_SAFE_ASSERT_RECOVER_NOOP(0 && "managed surface mode is active, but Krita is compiled without it!"); |
| 60 | multiConfig.canvasProfile = KoColorSpaceRegistry::instance()->p709SRGBProfile(); |
| 61 | multiConfig.uiProfile = KoColorSpaceRegistry::instance()->p709SRGBProfile(); |
| 62 | #endif /* KRITA_USE_SURFACE_COLOR_MANAGEMENT_API */ |
| 63 | } else { |
| 64 | const KoColorProfile *profile = cfg.displayProfile(screenId); |
| 65 | KIS_SAFE_ASSERT_RECOVER(profile) { |
| 66 | profile = KoColorSpaceRegistry::instance()->p709SRGBProfile(); |
| 67 | } |
| 68 | |
| 69 | multiConfig.canvasProfile = profile; |
| 70 | multiConfig.uiProfile = profile; |
| 71 | } |
| 72 | |
| 73 | multiConfig.setOptions(overriddenWithProofingConfig(state.optionsFromConfig, state.proofingConfig)); |
| 74 | multiConfig.isCanvasHDR = false; |
| 75 | |
| 76 | return state; |
| 77 | } |
| 78 | |
| 79 | KisMultiSurfaceStateManager::State KisMultiSurfaceStateManager::onCanvasSurfaceFormatChanged(const State &oldState, |
| 80 | const KisDisplayConfig &canvasConfig) const |
no test coverage detected