@@ -16,6 +16,7 @@ import { IInstantiationService } from '../../../platform/instantiation/common/in
1616import { TextureAtlas } from './atlas/textureAtlas.js' ;
1717import { IConfigurationService } from '../../../platform/configuration/common/configuration.js' ;
1818import { INotificationService , IPromptChoice , Severity } from '../../../platform/notification/common/notification.js' ;
19+ import { IThemeService } from '../../../platform/theme/common/themeService.js' ;
1920import { GPULifecycle } from './gpuDisposable.js' ;
2021import { ensureNonNullable , observeDevicePixelDimensions } from './gpuUtils.js' ;
2122import { RectangleRenderer } from './rectangleRenderer.js' ;
@@ -82,6 +83,7 @@ export class ViewGpuContext extends Disposable {
8283 @IInstantiationService private readonly _instantiationService : IInstantiationService ,
8384 @INotificationService private readonly _notificationService : INotificationService ,
8485 @IConfigurationService private readonly configurationService : IConfigurationService ,
86+ @IThemeService private readonly _themeService : IThemeService ,
8587 ) {
8688 super ( ) ;
8789
@@ -124,6 +126,12 @@ export class ViewGpuContext extends Disposable {
124126 this . devicePixelRatio = dprObs ;
125127 this . _register ( runOnChange ( this . devicePixelRatio , ( ) => ViewGpuContext . atlas ?. clear ( ) ) ) ;
126128
129+ // Clear decoration CSS caches when theme changes as CSS variables may have different values
130+ this . _register ( this . _themeService . onDidColorThemeChange ( ( ) => {
131+ ViewGpuContext . decorationCssRuleExtractor . clear ( ) ;
132+ ViewGpuContext . atlas ?. clear ( ) ;
133+ } ) ) ;
134+
127135 const canvasDevicePixelDimensions = observableValue ( this , { width : this . canvas . domNode . width , height : this . canvas . domNode . height } ) ;
128136 this . _register ( observeDevicePixelDimensions (
129137 this . canvas . domNode ,
0 commit comments