Bug 313211 [CSS] Optimizing Linear Gradients
bundles/org.eclipse.e4.ui.css.swt/src/org/eclipse/e4/ui/css/swt/properties/GradientBackgroundListener.java
}
	}
	private GradientBackgroundListener(Control control, Gradient grad) {
		this.grad = grad;
		this.control = control;
		control.addListener(SWT.Resize, this);
	}
	public static void handle(Control control, Gradient grad) {
		GradientBackgroundListener handler = handlers.get(control);
		if (handler == null) {
			handler = new GradientBackgroundListener(control, grad);
			handlers.put(control, handler);
		} else {
			handler.grad = grad;
			handler.handleEvent(null);
		}
	}
	public void handleEvent(Event event) {
		Point size = control.getSize();
		if (size.x <= 0 || size.y <= 0) {
			return;
		}
		/*
		 * Dispose the old background image.
		 */
		Image oldImage = control.getBackgroundImage();
		if (oldImage != null && !oldImage.isDisposed()) {
			oldImage.dispose();
			oldImage = null;
		}