arctest.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include <u.h>
  10. #include <libc.h>
  11. #include <draw.h>
  12. #include <memdraw.h>
  13. #include <memlayer.h>
  14. extern int drawdebug;
  15. void
  16. main(int argc, char **argv)
  17. {
  18. Memimage *x;
  19. Point c = {208,871};
  20. int a = 441;
  21. int b = 441;
  22. int thick = 0;
  23. Point sp = {0,0};
  24. int alpha = 51;
  25. int phi = 3;
  26. int64_t t0, t1;
  27. int i, n;
  28. int64_t del;
  29. if (argc != 2) {
  30. fprint(2, "usage: arctest number\n");
  31. exits("usage");
  32. }
  33. memimageinit();
  34. x = allocmemimage(Rect(0,0,1000,1000), CMAP8);
  35. n = atoi(argv[1]);
  36. t0 = nsec();
  37. t0 = nsec();
  38. t0 = nsec();
  39. t1 = nsec();
  40. del = t1-t0;
  41. t0 = nsec();
  42. for(i=0; i<n; i++)
  43. memarc(x, c, a, b, thick, memblack, sp, alpha, phi, SoverD);
  44. t1 = nsec();
  45. print("%lld %lld\n", t1-t0-del, del);
  46. }
  47. int drawdebug = 0;
  48. void
  49. rdb(void)
  50. {
  51. }
  52. int
  53. iprint(char *fmt, ...)
  54. {
  55. int n;
  56. va_list va;
  57. char buf[1024];
  58. va_start(va, fmt);
  59. n = vseprint(buf, buf+sizeof buf, fmt, va) - buf;
  60. va_end(va);
  61. write(1,buf,n);
  62. return 1;
  63. }