Performance performance = Performance.getDefault(); performance.tagAsGlobalSummary(meter, "GC.drawImage() transparent * " + count, Dimension.CPU_TIME);
public void test_drawImageLorg_eclipse_swt_graphics_ImageII() {	int count = 120000;		// precompute points	Rectangle bounds = gc.getClipping();	final int[][] coords = new int[count][];	int y = 0;	for (int i = 0; i < count; i++) {		int x = i % bounds.width;		coords[i] = new int[] {x,y};		if (x == 0) y += 3;	}		Color red = display.getSystemColor(SWT.COLOR_RED);	Color black = display.getSystemColor(SWT.COLOR_BLACK);	Color green = display.getSystemColor(SWT.COLOR_GREEN);	PaletteData paletteData = new PaletteData(new RGB[] {red.getRGB(), black.getRGB(), green.getRGB()});	ImageData data = new ImageData(30,30, 8, paletteData);	for (y = 0; y < data.height; y++) {		for (int x = 0; x < data.width; x++) {			if (x > y) data.setPixel(x, y, paletteData.getPixel(red.getRGB()));			else if (x < y) data.setPixel(x, y, paletteData.getPixel(black.getRGB()));			else data.setPixel(x, y, paletteData.getPixel(green.getRGB()));		}	}	Image imageNormal = new Image(display, data);	data = imageNormal.getImageData();	data.transparentPixel = paletteData.getPixel(red.getRGB());	Image imageTransparent = new Image(display, data);	data.transparentPixel = -1;	for (y = 0; y < data.height; y++) {		for (int x = 0; x < data.width; x++) {			data.setAlpha(x, y, 127);		}	}			Image imageAlpha = new Image(display, data);	gc.drawImage(imageNormal, 100, 100);	gc.drawImage(imageTransparent, 130, 100);	gc.drawImage(imageAlpha, 160, 100);		try {		PerformanceMeter meter = createMeter("GC drawImage - normal");		meter.start();		for (int i = 0; i < count; i++) {			gc.drawImage(imageNormal, coords[i][0], coords[i][1]);	// normal image		}		meter.stop();				disposeMeter(meter);			count /= 100;				meter = createMeter("GC drawImage - transparent");		Performance performance = Performance.getDefault();		performance.tagAsGlobalSummary(meter, "GC.drawImage() transparent * " + count, Dimension.CPU_TIME);		meter.start();		for (int i = 0; i < count; i++) {			gc.drawImage(imageTransparent, coords[i][0], coords[i][1]);	// transparent image		}		meter.stop();				disposeMeter(meter);			count *= 10;				meter = createMeter("GC drawImage - alpha");		meter.start();		for (int i = 0; i < count; i++) {			gc.drawImage(imageAlpha, coords[i][0], coords[i][1]);	// alpha image		}		meter.stop();				disposeMeter(meter);	} finally {		imageNormal.dispose();		imageTransparent.dispose();		imageAlpha.dispose();	}}