提交 9f482b34 编写于 作者: A Alex Dima

Hint GPU layers for editor sliders

上级 a3ea17e7
...@@ -1041,3 +1041,8 @@ export function domContentLoaded(): TPromise<any> { ...@@ -1041,3 +1041,8 @@ export function domContentLoaded(): TPromise<any> {
} }
}); });
} }
export function hintGPULayer(target: HTMLElement): void {
// This is to hint browsers that this dom node is suited to live in its own layer (e.g. sliders, etc.)
(<any>target.style).willChange = 'transform';
}
...@@ -170,6 +170,7 @@ export abstract class AbstractScrollbar extends Widget { ...@@ -170,6 +170,7 @@ export abstract class AbstractScrollbar extends Widget {
this.domNode.setTransform('translate3d(0px, 0px, 0px)'); this.domNode.setTransform('translate3d(0px, 0px, 0px)');
} else { } else {
this.domNode.setTransform(''); this.domNode.setTransform('');
DomUtils.hintGPULayer(this.domNode.domNode);
} }
this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()); this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize());
......
...@@ -413,6 +413,7 @@ export class Minimap extends ViewPart { ...@@ -413,6 +413,7 @@ export class Minimap extends ViewPart {
this._slider = createFastDomNode(document.createElement('div')); this._slider = createFastDomNode(document.createElement('div'));
this._slider.setPosition('absolute'); this._slider.setPosition('absolute');
this._slider.setClassName('minimap-slider'); this._slider.setClassName('minimap-slider');
dom.hintGPULayer(this._slider.domNode);
this._domNode.appendChild(this._slider); this._domNode.appendChild(this._slider);
this._tokensColorTracker = MinimapTokensColorTracker.getInstance(); this._tokensColorTracker = MinimapTokensColorTracker.getInstance();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册