#include "testscenarios.h" #include "surface.h" #include "utils.h" #include #include #include #include TestScenario * create_test_scenarios(Display *disp, Window win, int w, int h, int *number) { TestScenario *scenarios; *number = 7; scenarios = (TestScenario*)malloc(sizeof(TestScenario) * (*number)); int currentNumber = 0; TestScenario *current = &scenarios[currentNumber++]; /*********************************/ current->types = PlainTest; current->name = strdup("Plain"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = 0; current->src = xrender_surf_new(disp, win, PictStandardRGB24, 128, 128, False); populate_from_file(disp, current->dst, "images/bg1.png"); populate_from_file(disp, current->src, "images/xorg-small.png"); current = &scenarios[currentNumber++]; /*********************************/ current->types = PlainTest | AlphaTest; current->name = strdup("Plain With Alpha"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = 0; current->src = xrender_surf_new(disp, win,PictStandardARGB32, 128, 128, False); populate_from_file(disp, current->src, "images/xorg-small.png"); current = &scenarios[currentNumber++]; /*********************************/ current->types = PlainTest | AlphaTest | MaskTest; current->name = strdup("Plain With Alpha And Mask"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = xrender_surf_new(disp, win,PictStandardARGB32, 128, 128, False); current->src = xrender_surf_new(disp, win,PictStandardARGB32, 128, 128, False); populate_from_file(disp, current->mask, "images/mask.png"); populate_from_file(disp, current->src, "images/xorg-small.png"); current = &scenarios[currentNumber++]; /*********************************/ current->types = PlainTest | AlphaTest | MaskTest; current->name = strdup("Plain With Alpha And CA Mask"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = xrender_surf_new(disp, win,PictStandardARGB32, 128, 128, True); current->src = xrender_surf_new(disp, win,PictStandardARGB32, 128, 128, False); populate_from_file(disp, current->mask, "images/mask.png"); populate_from_file(disp, current->src, "images/xorg-small.png"); current = &scenarios[currentNumber++]; /*********************************/ current->types = TransformationTest; current->name = strdup("Transformation"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = 0; current->src = xrender_surf_new(disp, win, PictStandardRGB24, 128, 128, False); populate_from_file(disp, current->src, "images/xorg-small.png"); xrender_surf_prepare(disp, current->src, current->src->w, current->src->h, 1, SurfaceNone); current = &scenarios[currentNumber++]; /*********************************/ current->types = TransformationTest | FilterTest; current->name = strdup("Transformation/Bilinear filter"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = 0; current->src = xrender_surf_new(disp, win, PictStandardRGB24, 128, 128, False); populate_from_file(disp, current->src, "images/xorg-small.png"); xrender_surf_prepare(disp, current->src, current->src->w, current->src->h, 1, SurfaceBilinear); current = &scenarios[currentNumber++]; /*********************************/ current->types = ConvolutionTest; current->name = strdup("Convolution"); current->dst = xrender_surf_adopt(disp, win, w, h); current->mask = 0; current->src = xrender_surf_new(disp, win, PictStandardARGB32, 128, 128, False); populate_from_file(disp, current->src, "images/xorg-small.png"); xrender_surf_prepare(disp, current->src, current->src->w, current->src->h, 0, SurfaceConvolution); assert(*number == currentNumber); return scenarios; }