#include #include "renderops.h" #include "surface.h" #include "utils.h" #include #include #include extern XRenderSurf *surf_win; TestScenario * create_test_scenarios(Display *disp, Window win, int w, int h, int *number) { TestScenario *scenarios; *number = 3; scenarios = (TestScenario*)malloc(sizeof(TestScenario) * (*number)); /*********************************/ scenarios[0].name = strdup("Plain"); //scenerio[0].dst = xrender_surf_adopt(disp, win, DefaultVisual(disp, DefaultScreen(disp)), // win_w, win_h); scenarios[0].dst = surf_win; scenarios[0].mask = 0; scenarios[0].src = xrender_surf_new(disp, win, DefaultVisual(disp, DefaultScreen(disp)), 128, 128, 1); populate_from_file(disp, scenarios[0].dst, ":/res/images/bg1.jpg"); populate_from_file(disp, scenarios[0].src, ":/res/images/kde_gear_64.png"); /*********************************/ scenarios[1].name = strdup("Transformation"); //scenerios[1].dst = xrender_surf_adopt(disp, win, DefaultVisual(disp, DefaultScreen(disp)), // win_w, win_h); scenarios[1].dst = surf_win; scenarios[1].mask = 0; scenarios[1].src = xrender_surf_new(disp, win, DefaultVisual(disp, DefaultScreen(disp)), 128, 128, 1); populate_from_file(disp, scenarios[1].dst, ":/res/images/bg1.jpg"); populate_from_file(disp, scenarios[1].src, ":/res/images/kde_gear_64.png"); xrender_surf_prepare(disp, scenarios[1].src, scenarios[1].src->w, scenarios[1].src->h, 1, SurfaceNone); /*********************************/ scenarios[2].name = strdup("Transformation/Bilinear filter"); //scenerio[2].dst = xrender_surf_adopt(disp, win, DefaultVisual(disp, DefaultScreen(disp)), // win_w, win_h); scenarios[2].dst = surf_win; scenarios[2].mask = 0; scenarios[2].src = xrender_surf_new(disp, win, DefaultVisual(disp, DefaultScreen(disp)), 128, 128, 1); populate_from_file(disp, scenarios[2].dst, ":/res/images/bg1.jpg"); populate_from_file(disp, scenarios[2].src, ":/res/images/kde_gear_64.png"); xrender_surf_prepare(disp, scenarios[2].src, scenarios[2].src->w, scenarios[2].src->h, 1, SurfaceBilinear); return scenarios; }