// Path: protovis-benchmarks/src/pv/benchmark/Benchmark.java
// public interface Benchmark {
// 	public String name();
// 	public void setup();
// 	public void takedown();
// 	public long[] run(int iterations);
// }
// 
// Path: protovis-benchmarks/src/pv/benchmark/BenchmarkRunner.java
// public class BenchmarkRunner {
// 
// 	public static BenchmarkRunner instance = new BenchmarkRunner();
// 	
// 	private PrintStream out = System.out;
// 	private int iter = 6;
// 	private int minThreadCount = 5;
// 	private int maxThreadCount = 5;//Runtime.getRuntime().availableProcessors() + 2;
// 	
// 	public BenchmarkRunner() {
// 		System.out.println("AVAILABLE PROCESSSORS = " + Runtime.getRuntime().availableProcessors());
// 	}
// 	
// 	public void printStream(PrintStream ps) { out = ps; }
// 	public void iterations(int iters) { iter = iters; }
// 	
// 	public void run(String label, Benchmark b) {
// 		for (int nt=minThreadCount; nt<=maxThreadCount; ++nt) {
// 			ThreadPool.setThreadCount(nt);
// 			b.setup();
// 			for (int i=0; i<iter; ++i) {
// 				long[] t = b.run(1);
// 				double avg = average(t);
// 				out.println(nt + "\t" + (label==null?"":label+"-")+b.name() + "\t" + avg);
// 			}
// 			b.takedown();
// 		}
// 	}
// 	
// 	public static double average(long[] t) {
// 		double sum = 0;
// 		for (int i=0; i<t.length; ++i) {
// 			sum += t[i] / 1000.0;
// 		}
// 		return sum / t.length;
// 	}
// 	
// }


import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import pv.benchmark.Benchmark;
import pv.benchmark.BenchmarkRunner;
import pv.mark.Scene;
import pv.mark.constants.MarkType;
import pv.render.Display;
import pv.render.awt.CameraControl;
import pv.render.awt.java2D.Java2DDisplay;
import pv.render.awt.java2D.Java2DRenderer;
import pv.style.Fill;
import pv.style.Stroke;
			_renderer = r;
		}
	}

	private List<Integer> data, layers;
	private PDisplay display;
	
	public SoftwareRenderingBenchmark()
	{	
		int NDATA = 1000, NLAYERS = 50;
		
		data = new ArrayList<Integer>();
		for (int i=0; i<NDATA; ++i) data.add(i);
		
		layers = new ArrayList<Integer>();
		for (int i=0; i<NLAYERS; ++i) layers.add(i);
		
		display = new PDisplay();
		display.setSize(1024, 768);
		new CameraControl().attach(display);
		
		JFrame frame = new JFrame("Software Rendering Benchmark");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(display);
		frame.pack();
		frame.setVisible(true);
		
		display.setRenderer(Java2DRenderer.instance());
		BenchmarkRunner.instance.iterations(101);
		for (Benchmark b : benchmarks()) {
// Path: protovis-benchmarks/src/pv/benchmark/Benchmark.java
// public interface Benchmark {
// 	public String name();
// 	public void setup();
// 	public void takedown();
// 	public long[] run(int iterations);
// }
// 
// Path: protovis-benchmarks/src/pv/benchmark/BenchmarkRunner.java
// public class BenchmarkRunner {
// 
// 	public static BenchmarkRunner instance = new BenchmarkRunner();
// 	
// 	private PrintStream out = System.out;
// 	private int iter = 6;
// 	private int minThreadCount = 5;
// 	private int maxThreadCount = 5;//Runtime.getRuntime().availableProcessors() + 2;
// 	
// 	public BenchmarkRunner() {
// 		System.out.println("AVAILABLE PROCESSSORS = " + Runtime.getRuntime().availableProcessors());
// 	}
// 	
// 	public void printStream(PrintStream ps) { out = ps; }
// 	public void iterations(int iters) { iter = iters; }
// 	
// 	public void run(String label, Benchmark b) {
// 		for (int nt=minThreadCount; nt<=maxThreadCount; ++nt) {
// 			ThreadPool.setThreadCount(nt);
// 			b.setup();
// 			for (int i=0; i<iter; ++i) {
// 				long[] t = b.run(1);
// 				double avg = average(t);
// 				out.println(nt + "\t" + (label==null?"":label+"-")+b.name() + "\t" + avg);
// 			}
// 			b.takedown();
// 		}
// 	}
// 	
// 	public static double average(long[] t) {
// 		double sum = 0;
// 		for (int i=0; i<t.length; ++i) {
// 			sum += t[i] / 1000.0;
// 		}
// 		return sum / t.length;
// 	}
// 	
// }


// Path: protovis-benchmarks/src/pv/benchmark/render/SoftwareRenderingBenchmark.java
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import pv.benchmark.Benchmark;
import pv.benchmark.BenchmarkRunner;
import pv.mark.Scene;
import pv.mark.constants.MarkType;
import pv.render.Display;
import pv.render.awt.CameraControl;
import pv.render.awt.java2D.Java2DDisplay;
import pv.render.awt.java2D.Java2DRenderer;
import pv.style.Fill;
import pv.style.Stroke;

			_renderer = r;
		}
	}

	private List<Integer> data, layers;
	private PDisplay display;
	
	public SoftwareRenderingBenchmark()
	{	
		int NDATA = 1000, NLAYERS = 50;
		
		data = new ArrayList<Integer>();
		for (int i=0; i<NDATA; ++i) data.add(i);
		
		layers = new ArrayList<Integer>();
		for (int i=0; i<NLAYERS; ++i) layers.add(i);
		
		display = new PDisplay();
		display.setSize(1024, 768);
		new CameraControl().attach(display);
		
		JFrame frame = new JFrame("Software Rendering Benchmark");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(display);
		frame.pack();
		frame.setVisible(true);
		
		display.setRenderer(Java2DRenderer.instance());
		BenchmarkRunner.instance.iterations(101);
		for (Benchmark b : benchmarks()) {
			BenchmarkRunner.instance.run("SFT", b);