Exemple #1
0
static void test_path_with_hole(skiatest::Reporter* reporter) {
    static const uint8_t gExpectedImage[] = {
        0xFF, 0xFF, 0xFF, 0xFF,
        0xFF, 0xFF, 0xFF, 0xFF,
        0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00,
        0xFF, 0xFF, 0xFF, 0xFF,
        0xFF, 0xFF, 0xFF, 0xFF,
    };
    SkMask expected;
    expected.fBounds.set(0, 0, 4, 6);
    expected.fRowBytes = 4;
    expected.fFormat = SkMask::kA8_Format;
    expected.fImage = (uint8_t*)gExpectedImage;

    SkPath path;
    path.addRect(SkRect::MakeXYWH(0, 0,
                                  SkIntToScalar(4), SkIntToScalar(2)));
    path.addRect(SkRect::MakeXYWH(0, SkIntToScalar(4),
                                  SkIntToScalar(4), SkIntToScalar(2)));

    for (int i = 0; i < 2; ++i) {
        SkAAClip clip;
        clip.setPath(path, nullptr, 1 == i);

        SkMask mask;
        clip.copyToMask(&mask);
        SkAutoMaskFreeImage freeM(mask.fImage);

        REPORTER_ASSERT(reporter, expected == mask);
    }
}
Exemple #2
0
int main(int argc, char **argv)
{
	source * src;
	int i;
	int * M;
	int * resultat;
       
	if(argc < 2)
	{
	    printf("syntaxe : %s benchmarks_Taillard/...\n", argv[0]);
	    return -1;
	}
	src=readsrc(argv[1]);          // table de durée d'opération Tab[][]
	M=TabtoM(src);                 // table de durée d'opération M[]
    //aff_source(src);
	//aff_M(M,src->n,src->m);

	// ILS
	resultat=ILS(M, src->n, src->m);
	printf("ILS la séquence de Jobs est: \n");
	for(i=0;i<src->n;i++)	
		printf("%-4d",resultat[i]);
	printf("\nILS la somme de date de fin est:  %d\n",calculateCbarre(M, src->m, src->n, resultat, src->n));

	// IGA
	resultat=IGA(M, src->n, src->m);
	printf("IGA la séquence de Jobs est: \n");
	for(i=0;i<src->n;i++)	
		printf("%-4d",resultat[i]);	
	printf("\nIGA la somme de date de fin est:  %d\n",calculateCbarre(M, src->m, src->n, resultat, src->n));
	
	free(resultat);
	freeSource(src);
	freeM(M);

	return 1;
}