Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2346 lines
63 KiB

  1. /**************************************************************************\
  2. *
  3. * Copyright (c) 2000 Microsoft Corporation
  4. *
  5. * Module Name:
  6. *
  7. * perffill.cpp
  8. *
  9. * Abstract:
  10. *
  11. * Contains all the tests for any routines that 'Fill'.
  12. *
  13. \**************************************************************************/
  14. #include "perftest.h"
  15. float Fill_Ellipse_PerCall_Big_Solid(Graphics *g, HDC hdc)
  16. {
  17. UINT iterations;
  18. float seconds;
  19. if (g)
  20. {
  21. StartTimer();
  22. do {
  23. SolidBrush brush(Color::Red);
  24. g->FillEllipse(&brush, 0, 0, 512, 512);
  25. } while (!EndTimer());
  26. g->Flush(FlushIntentionSync);
  27. GetTimer(&seconds, &iterations);
  28. }
  29. else
  30. {
  31. HGDIOBJ hpen = GetStockObject(NULL_PEN);
  32. HGDIOBJ oldPen = SelectObject(hdc, hpen);
  33. StartTimer();
  34. do {
  35. HBRUSH hbrush = CreateSolidBrush(RGB(255, 0, 0));
  36. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  37. Ellipse(hdc, 0, 0, 512, 512);
  38. SelectObject(hdc, oldBrush);
  39. DeleteObject(hbrush);
  40. } while (!EndTimer());
  41. GdiFlush();
  42. GetTimer(&seconds, &iterations);
  43. SelectObject(hdc, oldPen);
  44. DeleteObject(hpen);
  45. }
  46. return(iterations / seconds / KILO); // Kilo-calls per second
  47. }
  48. float Fill_Ellipse_PerCall_Small_Solid(Graphics *g, HDC hdc)
  49. {
  50. UINT iterations;
  51. float seconds;
  52. if (g)
  53. {
  54. StartTimer();
  55. do {
  56. SolidBrush brush(Color::Red);
  57. g->FillEllipse(&brush, 64, 64, 64, 64);
  58. } while (!EndTimer());
  59. g->Flush(FlushIntentionSync);
  60. GetTimer(&seconds, &iterations);
  61. }
  62. else
  63. {
  64. HGDIOBJ hpen = GetStockObject(NULL_PEN);
  65. HGDIOBJ oldPen = SelectObject(hdc, hpen);
  66. StartTimer();
  67. do {
  68. HBRUSH hbrush = CreateSolidBrush(RGB(255, 0, 0));
  69. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  70. Ellipse(hdc, 64, 64, 128, 128);
  71. SelectObject(hdc, oldBrush);
  72. DeleteObject(hbrush);
  73. } while (!EndTimer());
  74. GdiFlush();
  75. GetTimer(&seconds, &iterations);
  76. SelectObject(hdc, oldPen);
  77. DeleteObject(hpen);
  78. }
  79. return(iterations / seconds / KILO); // Kilo-calls per second
  80. }
  81. float Fill_Rectangle_PerPixel_Solid_Opaque_Aliased(Graphics *g, HDC hdc)
  82. {
  83. UINT iterations;
  84. float seconds;
  85. if (!g) return(0); // There is no GDI equivalent
  86. SolidBrush brush(Color::Red);
  87. StartTimer();
  88. do {
  89. g->FillRectangle(&brush, 10, 10, 512, 512);
  90. } while (!EndTimer());
  91. g->Flush(FlushIntentionSync);
  92. GetTimer(&seconds, &iterations);
  93. UINT pixels = 512 * 512 * iterations;
  94. return(pixels / seconds / MEGA); // Mega-pixels per second
  95. }
  96. float Fill_Rectangle_PerPixel_Solid_Opaque_Antialiased_Integer(Graphics *g, HDC hdc)
  97. {
  98. UINT iterations;
  99. float seconds;
  100. if (!g) return(0); // There is no GDI equivalent
  101. g->SetSmoothingMode(SmoothingModeAntiAlias);
  102. SolidBrush brush(Color::Red);
  103. StartTimer();
  104. do {
  105. g->FillRectangle(&brush, 10, 10, 512, 512);
  106. } while (!EndTimer());
  107. g->Flush(FlushIntentionSync);
  108. GetTimer(&seconds, &iterations);
  109. UINT pixels = 512 * 512 * iterations;
  110. return(pixels / seconds / MEGA); // Mega-pixels per second
  111. }
  112. float Fill_Rectangle_PerPixel_Solid_Opaque_Antialiased_HalfInteger(Graphics *g, HDC hdc)
  113. {
  114. UINT iterations;
  115. float seconds;
  116. if (!g) return(0); // There is no GDI equivalent
  117. g->SetSmoothingMode(SmoothingModeAntiAlias);
  118. SolidBrush brush(Color::Red);
  119. StartTimer();
  120. do {
  121. g->FillRectangle(&brush, 10.5f, 10.5f, 512.0f, 512.0f);
  122. } while (!EndTimer());
  123. g->Flush(FlushIntentionSync);
  124. GetTimer(&seconds, &iterations);
  125. UINT pixels = 512 * 512 * iterations;
  126. return(pixels / seconds / MEGA); // Mega-pixels per second
  127. }
  128. float Fill_Rectangle_PerCall_Solid_Opaque_Aliased(Graphics *g, HDC hdc)
  129. {
  130. UINT iterations;
  131. float seconds;
  132. if (g)
  133. {
  134. StartTimer();
  135. do {
  136. SolidBrush brush(Color::Red);
  137. g->FillRectangle(&brush, 20, 20, 1, 1);
  138. } while (!EndTimer());
  139. g->Flush(FlushIntentionSync);
  140. GetTimer(&seconds, &iterations);
  141. }
  142. else
  143. {
  144. StartTimer();
  145. do {
  146. RECT rect = { 20, 20, 21, 21 };
  147. HBRUSH hbrush = CreateSolidBrush(RGB(255, 0, 0));
  148. FillRect(hdc, &rect, hbrush);
  149. DeleteObject(hbrush);
  150. } while (!EndTimer());
  151. GdiFlush();
  152. GetTimer(&seconds, &iterations);
  153. }
  154. return(iterations / seconds / KILO); // Kilo-calls per second
  155. }
  156. float Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased(Graphics *g, HDC hdc)
  157. {
  158. UINT iterations;
  159. float seconds;
  160. if (g)
  161. {
  162. SolidBrush brush(Color::Red);
  163. PointF points[] = { PointF(0, 0), PointF(512, 0),
  164. PointF(513, 512), PointF(1, 512) };
  165. StartTimer();
  166. do {
  167. g->FillPolygon(&brush, points, 4);
  168. } while (!EndTimer());
  169. g->Flush(FlushIntentionSync);
  170. GetTimer(&seconds, &iterations);
  171. }
  172. else
  173. {
  174. HBRUSH hbrush = CreateSolidBrush(RGB(255, 0, 0));
  175. HGDIOBJ hpen = GetStockObject(NULL_PEN);
  176. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  177. HGDIOBJ oldPen = SelectObject(hdc, hpen);
  178. POINT points[] = { 0, 0, 512, 0, 513, 512, 1, 512 };
  179. StartTimer();
  180. do {
  181. Polygon(hdc, points, 4);
  182. } while (!EndTimer());
  183. GdiFlush();
  184. GetTimer(&seconds, &iterations);
  185. SelectObject(hdc, oldBrush);
  186. SelectObject(hdc, oldPen);
  187. DeleteObject(hbrush);
  188. DeleteObject(hpen);
  189. }
  190. UINT pixels = 512 * 512 * iterations;
  191. return(pixels / seconds / MEGA); // Mega-pixels per second
  192. }
  193. float Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_CompatibleDIB(Graphics *gScreen, HDC hdcScreen)
  194. {
  195. UINT iterations;
  196. float seconds;
  197. if (!gScreen) return(0); // There is no GDI equivalent
  198. // Note that this doesn't use the passed-in 'Graphics' at all in the
  199. // timing.
  200. HDC screenDc = gScreen->GetHDC();
  201. HBITMAP bitmap = CreateCompatibleDIB2(screenDc, 520, 520);
  202. HDC dc = CreateCompatibleDC(screenDc);
  203. SelectObject(dc, bitmap);
  204. Graphics g(dc);
  205. SolidBrush brush(Color::Red);
  206. PointF points[] = { PointF(0, 0), PointF(512, 0),
  207. PointF(513, 512), PointF(1, 512) };
  208. StartTimer();
  209. do {
  210. g.FillPolygon(&brush, points, 4);
  211. } while (!EndTimer());
  212. g.Flush(FlushIntentionSync);
  213. GetTimer(&seconds, &iterations);
  214. BitBlt(screenDc, 0, 0, 520, 520, dc, 0, 0, SRCCOPY);
  215. gScreen->ReleaseHDC(screenDc);
  216. DeleteObject(dc);
  217. DeleteObject(bitmap);
  218. UINT pixels = 512 * 512 * iterations;
  219. return(pixels / seconds / MEGA); // Mega-pixels per second
  220. }
  221. float Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_15bpp(Graphics *gScreen, HDC hdcScreen)
  222. {
  223. UINT iterations;
  224. float seconds;
  225. if (!gScreen) return(0); // There is no GDI equivalent
  226. // Note that this doesn't use the passed-in 'Graphics' at all in the
  227. // timing.
  228. Bitmap bitmap(520, 520, PixelFormat16bppRGB555);
  229. Graphics g(&bitmap);
  230. SolidBrush brush(Color::Red);
  231. PointF points[] = { PointF(0, 0), PointF(512, 0),
  232. PointF(513, 512), PointF(1, 512) };
  233. StartTimer();
  234. do {
  235. g.FillPolygon(&brush, points, 4);
  236. } while (!EndTimer());
  237. g.Flush(FlushIntentionSync);
  238. GetTimer(&seconds, &iterations);
  239. gScreen->DrawImage(&bitmap, 0, 0);
  240. UINT pixels = 512 * 512 * iterations;
  241. return(pixels / seconds / MEGA); // Mega-pixels per second
  242. }
  243. float Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_16bpp(Graphics *gScreen, HDC hdcScreen)
  244. {
  245. UINT iterations;
  246. float seconds;
  247. if (!gScreen) return(0); // There is no GDI equivalent
  248. // Note that this doesn't use the passed-in 'Graphics' at all in the
  249. // timing.
  250. Bitmap bitmap(520, 520, PixelFormat16bppRGB565);
  251. Graphics g(&bitmap);
  252. SolidBrush brush(Color::Red);
  253. PointF points[] = { PointF(0, 0), PointF(512, 0),
  254. PointF(513, 512), PointF(1, 512) };
  255. StartTimer();
  256. do {
  257. g.FillPolygon(&brush, points, 4);
  258. } while (!EndTimer());
  259. g.Flush(FlushIntentionSync);
  260. GetTimer(&seconds, &iterations);
  261. gScreen->DrawImage(&bitmap, 0, 0);
  262. UINT pixels = 512 * 512 * iterations;
  263. return(pixels / seconds / MEGA); // Mega-pixels per second
  264. }
  265. float Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_24bpp(Graphics *gScreen, HDC hdcScreen)
  266. {
  267. UINT iterations;
  268. float seconds;
  269. if (!gScreen) return(0); // There is no GDI equivalent
  270. // Note that this doesn't use the passed-in 'Graphics' at all in the
  271. // timing.
  272. Bitmap bitmap(520, 520, PixelFormat24bppRGB);
  273. Graphics g(&bitmap);
  274. SolidBrush brush(Color::Red);
  275. PointF points[] = { PointF(0, 0), PointF(512, 0),
  276. PointF(513, 512), PointF(1, 512) };
  277. StartTimer();
  278. do {
  279. g.FillPolygon(&brush, points, 4);
  280. } while (!EndTimer());
  281. g.Flush(FlushIntentionSync);
  282. GetTimer(&seconds, &iterations);
  283. gScreen->DrawImage(&bitmap, 0, 0);
  284. UINT pixels = 512 * 512 * iterations;
  285. return(pixels / seconds / MEGA); // Mega-pixels per second
  286. }
  287. float Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_32bpp(Graphics *gScreen, HDC hdcScreen)
  288. {
  289. UINT iterations;
  290. float seconds;
  291. if (!gScreen) return(0); // There is no GDI equivalent
  292. // Note that this doesn't use the passed-in 'Graphics' at all in the
  293. // timing.
  294. Bitmap bitmap(520, 520, PixelFormat32bppRGB);
  295. Graphics g(&bitmap);
  296. SolidBrush brush(Color::Red);
  297. PointF points[] = { PointF(0, 0), PointF(512, 0),
  298. PointF(513, 512), PointF(1, 512) };
  299. StartTimer();
  300. do {
  301. g.FillPolygon(&brush, points, 4);
  302. } while (!EndTimer());
  303. g.Flush(FlushIntentionSync);
  304. GetTimer(&seconds, &iterations);
  305. gScreen->DrawImage(&bitmap, 0, 0);
  306. UINT pixels = 512 * 512 * iterations;
  307. return(pixels / seconds / MEGA); // Mega-pixels per second
  308. }
  309. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased(Graphics *g, HDC hdc)
  310. {
  311. UINT iterations;
  312. float seconds;
  313. if (!g) return(0); // There is no GDI equivalent
  314. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  315. PointF points[] = { PointF(0, 0), PointF(512, 0),
  316. PointF(513, 512), PointF(1, 512) };
  317. StartTimer();
  318. do {
  319. g->FillPolygon(&brush, points, 4);
  320. } while (!EndTimer());
  321. g->Flush(FlushIntentionSync);
  322. GetTimer(&seconds, &iterations);
  323. UINT pixels = 512 * 512 * iterations;
  324. return(pixels / seconds / MEGA); // Mega-pixels per second
  325. }
  326. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Quality(Graphics *g, HDC hdc)
  327. {
  328. UINT iterations;
  329. float seconds;
  330. if (!g) return(0); // There is no GDI equivalent
  331. g->SetCompositingQuality(CompositingQualityHighQuality);
  332. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  333. PointF points[] = { PointF(0, 0), PointF(512, 0),
  334. PointF(513, 512), PointF(1, 512) };
  335. StartTimer();
  336. do {
  337. g->FillPolygon(&brush, points, 4);
  338. } while (!EndTimer());
  339. g->Flush(FlushIntentionSync);
  340. GetTimer(&seconds, &iterations);
  341. UINT pixels = 512 * 512 * iterations;
  342. return(pixels / seconds / MEGA); // Mega-pixels per second
  343. }
  344. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_CompatibleDIB(Graphics *gScreen, HDC hdcScreen)
  345. {
  346. UINT iterations;
  347. float seconds;
  348. if (!gScreen) return(0); // There is no GDI equivalent
  349. // Note that this doesn't use the passed-in 'Graphics' at all in the
  350. // timing.
  351. HDC screenDc = gScreen->GetHDC();
  352. HBITMAP bitmap = CreateCompatibleDIB2(screenDc, 520, 520);
  353. HDC dc = CreateCompatibleDC(screenDc);
  354. SelectObject(dc, bitmap);
  355. Graphics g(dc);
  356. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  357. PointF points[] = { PointF(0, 0), PointF(512, 0),
  358. PointF(513, 512), PointF(1, 512) };
  359. StartTimer();
  360. do {
  361. g.FillPolygon(&brush, points, 4);
  362. } while (!EndTimer());
  363. g.Flush(FlushIntentionSync);
  364. GetTimer(&seconds, &iterations);
  365. BitBlt(screenDc, 0, 0, 520, 520, dc, 0, 0, SRCCOPY);
  366. gScreen->ReleaseHDC(screenDc);
  367. DeleteObject(dc);
  368. DeleteObject(bitmap);
  369. UINT pixels = 512 * 512 * iterations;
  370. return(pixels / seconds / MEGA); // Mega-pixels per second
  371. }
  372. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_15bpp(Graphics *gScreen, HDC hdcScreen)
  373. {
  374. UINT iterations;
  375. float seconds;
  376. if (!gScreen) return(0); // There is no GDI equivalent
  377. // Note that this doesn't use the passed-in 'Graphics' at all in the
  378. // timing.
  379. Bitmap bitmap(520, 520, PixelFormat16bppRGB555);
  380. Graphics g(&bitmap);
  381. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  382. PointF points[] = { PointF(0, 0), PointF(512, 0),
  383. PointF(513, 512), PointF(1, 512) };
  384. StartTimer();
  385. do {
  386. g.FillPolygon(&brush, points, 4);
  387. } while (!EndTimer());
  388. g.Flush(FlushIntentionSync);
  389. GetTimer(&seconds, &iterations);
  390. gScreen->DrawImage(&bitmap, 0, 0);
  391. UINT pixels = 512 * 512 * iterations;
  392. return(pixels / seconds / MEGA); // Mega-pixels per second
  393. }
  394. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_16bpp(Graphics *gScreen, HDC hdcScreen)
  395. {
  396. UINT iterations;
  397. float seconds;
  398. if (!gScreen) return(0); // There is no GDI equivalent
  399. // Note that this doesn't use the passed-in 'Graphics' at all in the
  400. // timing.
  401. Bitmap bitmap(520, 520, PixelFormat16bppRGB565);
  402. Graphics g(&bitmap);
  403. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  404. PointF points[] = { PointF(0, 0), PointF(512, 0),
  405. PointF(513, 512), PointF(1, 512) };
  406. StartTimer();
  407. do {
  408. g.FillPolygon(&brush, points, 4);
  409. } while (!EndTimer());
  410. g.Flush(FlushIntentionSync);
  411. GetTimer(&seconds, &iterations);
  412. gScreen->DrawImage(&bitmap, 0, 0);
  413. UINT pixels = 512 * 512 * iterations;
  414. return(pixels / seconds / MEGA); // Mega-pixels per second
  415. }
  416. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_24bpp(Graphics *gScreen, HDC hdcScreen)
  417. {
  418. UINT iterations;
  419. float seconds;
  420. if (!gScreen) return(0); // There is no GDI equivalent
  421. // Note that this doesn't use the passed-in 'Graphics' at all in the
  422. // timing.
  423. Bitmap bitmap(520, 520, PixelFormat24bppRGB);
  424. Graphics g(&bitmap);
  425. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  426. PointF points[] = { PointF(0, 0), PointF(512, 0),
  427. PointF(513, 512), PointF(1, 512) };
  428. StartTimer();
  429. do {
  430. g.FillPolygon(&brush, points, 4);
  431. } while (!EndTimer());
  432. g.Flush(FlushIntentionSync);
  433. GetTimer(&seconds, &iterations);
  434. gScreen->DrawImage(&bitmap, 0, 0);
  435. UINT pixels = 512 * 512 * iterations;
  436. return(pixels / seconds / MEGA); // Mega-pixels per second
  437. }
  438. float Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_32bpp(Graphics *gScreen, HDC hdcScreen)
  439. {
  440. UINT iterations;
  441. float seconds;
  442. if (!gScreen) return(0); // There is no GDI equivalent
  443. // Note that this doesn't use the passed-in 'Graphics' at all in the
  444. // timing.
  445. Bitmap bitmap(520, 520, PixelFormat32bppRGB);
  446. Graphics g(&bitmap);
  447. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  448. PointF points[] = { PointF(0, 0), PointF(512, 0),
  449. PointF(513, 512), PointF(1, 512) };
  450. StartTimer();
  451. do {
  452. g.FillPolygon(&brush, points, 4);
  453. } while (!EndTimer());
  454. g.Flush(FlushIntentionSync);
  455. GetTimer(&seconds, &iterations);
  456. gScreen->DrawImage(&bitmap, 0, 0);
  457. UINT pixels = 512 * 512 * iterations;
  458. return(pixels / seconds / MEGA); // Mega-pixels per second
  459. }
  460. float Fill_Trapezoid_PerCall_Solid_Opaque_Aliased(Graphics *g, HDC hdc)
  461. {
  462. UINT iterations;
  463. float seconds;
  464. if (g)
  465. {
  466. StartTimer();
  467. do {
  468. SolidBrush brush(Color::Red);
  469. PointF points[] = { PointF(20, 20), PointF(21, 20),
  470. PointF(21, 21), PointF(20, 21) };
  471. g->FillPolygon(&brush, points, 4);
  472. } while (!EndTimer());
  473. g->Flush(FlushIntentionSync);
  474. GetTimer(&seconds, &iterations);
  475. }
  476. else
  477. {
  478. StartTimer();
  479. HGDIOBJ hpen = GetStockObject(NULL_PEN);
  480. HGDIOBJ oldPen = SelectObject(hdc, hpen);
  481. do {
  482. HBRUSH hbrush = CreateSolidBrush(RGB(255, 0, 0));
  483. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  484. POINT points[] = { 20, 20, 21, 20, 21, 21, 20, 21 };
  485. Polygon(hdc, points, 4);
  486. SelectObject(hdc, oldBrush);
  487. DeleteObject(hbrush);
  488. } while (!EndTimer());
  489. GdiFlush();
  490. GetTimer(&seconds, &iterations);
  491. SelectObject(hdc, oldPen);
  492. DeleteObject(hpen);
  493. }
  494. return(iterations / seconds / KILO); // Kilo-calls per second
  495. }
  496. float Fill_Trapezoid_PerPixel_Texture_Identity_Opaque_Antialiased(Graphics *g, HDC hdc)
  497. {
  498. UINT iterations;
  499. float seconds;
  500. if (!g) return(0); // No GDI equivalent
  501. g->SetSmoothingMode(SmoothingModeAntiAlias);
  502. Bitmap bitmap(L"winnt256.bmp");
  503. TextureBrush brush(&bitmap);
  504. PointF points[] = { PointF(10, 10), PointF(522, 10),
  505. PointF(523, 522), PointF(11, 522) };
  506. StartTimer();
  507. do {
  508. g->FillPolygon(&brush, points, 4);
  509. } while (!EndTimer());
  510. g->Flush(FlushIntentionSync);
  511. GetTimer(&seconds, &iterations);
  512. UINT pixels = 512 * 512 * iterations;
  513. return(pixels / seconds / MEGA); // Mega-pixels per second
  514. }
  515. float Fill_Trapezoid_PerPixel_Texture_Scaled_Opaque_Antialiased(Graphics *g, HDC hdc)
  516. {
  517. UINT iterations;
  518. float seconds;
  519. if (!g) return(0); // No GDI equivalent
  520. g->SetSmoothingMode(SmoothingModeAntiAlias);
  521. Bitmap bitmap(L"winnt256.bmp");
  522. TextureBrush brush(&bitmap);
  523. PointF points[] = { PointF(10, 10), PointF(522, 10),
  524. PointF(523, 522), PointF(11, 522) };
  525. Matrix matrix(0.5, 0, 0, 0.5, 0, 0);
  526. brush.SetTransform(&matrix);
  527. StartTimer();
  528. do {
  529. g->FillPolygon(&brush, points, 4);
  530. } while (!EndTimer());
  531. g->Flush(FlushIntentionSync);
  532. GetTimer(&seconds, &iterations);
  533. UINT pixels = 512 * 512 * iterations;
  534. return(pixels / seconds / MEGA); // Mega-pixels per second
  535. }
  536. float Fill_Trapezoid_PerPixel_Solid_Opaque_Antialiased_Quality(Graphics *g, HDC hdc)
  537. {
  538. UINT iterations;
  539. float seconds;
  540. if (!g) return(0); // There is no GDI equivalent
  541. g->SetSmoothingMode(SmoothingModeAntiAlias);
  542. g->SetCompositingQuality(CompositingQualityHighQuality);
  543. SolidBrush brush(Color::Red);
  544. PointF points[] = { PointF(10, 10), PointF(522, 10),
  545. PointF(523, 522), PointF(11, 522) };
  546. StartTimer();
  547. do {
  548. g->FillPolygon(&brush, points, 4);
  549. } while (!EndTimer());
  550. g->Flush(FlushIntentionSync);
  551. GetTimer(&seconds, &iterations);
  552. UINT pixels = 512 * 512 * iterations;
  553. return(pixels / seconds / MEGA); // Mega-pixels per second
  554. }
  555. float Fill_Trapezoid_PerPixel_Solid_Opaque_Antialiased(Graphics *g, HDC hdc)
  556. {
  557. UINT iterations;
  558. float seconds;
  559. if (!g) return(0); // There is no GDI equivalent
  560. g->SetSmoothingMode(SmoothingModeAntiAlias);
  561. SolidBrush brush(Color::Red);
  562. PointF points[] = { PointF(10, 10), PointF(522, 10),
  563. PointF(523, 522), PointF(11, 522) };
  564. StartTimer();
  565. do {
  566. g->FillPolygon(&brush, points, 4);
  567. } while (!EndTimer());
  568. g->Flush(FlushIntentionSync);
  569. GetTimer(&seconds, &iterations);
  570. UINT pixels = 512 * 512 * iterations;
  571. return(pixels / seconds / MEGA); // Mega-pixels per second
  572. }
  573. float Fill_Trapezoid_PerCall_Solid_Opaque_Antialiased(Graphics *g, HDC hdc)
  574. {
  575. UINT iterations;
  576. float seconds;
  577. if (!g) return(0); // There is no GDI equivalent
  578. g->SetSmoothingMode(SmoothingModeAntiAlias);
  579. StartTimer();
  580. do {
  581. SolidBrush brush(Color::Red);
  582. PointF points[] = { PointF(20, 20), PointF(21, 20),
  583. PointF(21, 21), PointF(20, 21) };
  584. g->FillPolygon(&brush, points, 4);
  585. } while (!EndTimer());
  586. g->Flush(FlushIntentionSync);
  587. GetTimer(&seconds, &iterations);
  588. return(iterations / seconds / KILO); // Kilo-calls per second
  589. }
  590. float Fill_Trapezoid_PerPixel_Solid_Transparent_Antialiased(Graphics *g, HDC hdc)
  591. {
  592. UINT iterations;
  593. float seconds;
  594. if (!g) return(0); // There is no GDI equivalent
  595. g->SetSmoothingMode(SmoothingModeAntiAlias);
  596. Color color(0x80, 0x80, 0, 0);
  597. SolidBrush brush(color);
  598. PointF points[] = { PointF(10, 10), PointF(522, 10),
  599. PointF(523, 522), PointF(11, 522) };
  600. StartTimer();
  601. do {
  602. g->FillPolygon(&brush, points, 4);
  603. } while (!EndTimer());
  604. g->Flush(FlushIntentionSync);
  605. GetTimer(&seconds, &iterations);
  606. UINT pixels = 512 * 512 * iterations;
  607. return(pixels / seconds / MEGA); // Mega-pixels per second
  608. }
  609. float Fill_Trapezoid_PerCall_Solid_Transparent_Antialiased(Graphics *g, HDC hdc)
  610. {
  611. UINT iterations;
  612. float seconds;
  613. if (!g) return(0); // There is no GDI equivalent
  614. g->SetSmoothingMode(SmoothingModeAntiAlias);
  615. StartTimer();
  616. do {
  617. Color color(0x80, 0x80, 0, 0);
  618. SolidBrush brush(color);
  619. PointF points[] = { PointF(20, 20), PointF(21, 20),
  620. PointF(21, 21), PointF(20, 21) };
  621. g->FillPolygon(&brush, points, 4);
  622. } while (!EndTimer());
  623. g->Flush(FlushIntentionSync);
  624. GetTimer(&seconds, &iterations);
  625. return(iterations / seconds / KILO); // Kilo-calls per second
  626. }
  627. float Fill_Rectangle_PerPixel_Hatch_Opaque(Graphics *g, HDC hdc)
  628. {
  629. UINT iterations;
  630. float seconds;
  631. if (g)
  632. {
  633. HatchBrush brush(HatchStyleDiagonalCross, Color::Red, Color::Black);
  634. StartTimer();
  635. do {
  636. g->FillRectangle(&brush, 0, 0, 512, 512);
  637. } while (!EndTimer());
  638. g->Flush(FlushIntentionSync);
  639. GetTimer(&seconds, &iterations);
  640. }
  641. else
  642. {
  643. HBRUSH hbrush = CreateHatchBrush(HS_DIAGCROSS, RGB(0xff, 0, 0));
  644. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  645. StartTimer();
  646. do {
  647. PatBlt(hdc, 0, 0, 512, 512, PATCOPY);
  648. } while (!EndTimer());
  649. GdiFlush();
  650. GetTimer(&seconds, &iterations);
  651. SelectObject(hdc, oldBrush);
  652. DeleteObject(hbrush);
  653. }
  654. UINT pixels = 512 * 512 * iterations;
  655. return(pixels / seconds / MEGA); // Mega-pixels per second
  656. }
  657. float Fill_Rectangle_PerPixel_Hatch_Transparent(Graphics *g, HDC hdc)
  658. {
  659. UINT iterations;
  660. float seconds;
  661. if (g)
  662. {
  663. HatchBrush brush(HatchStyleDiagonalCross, Color::Red, Color(0, 0, 0, 0));
  664. StartTimer();
  665. do {
  666. g->FillRectangle(&brush, 0, 0, 512, 512);
  667. } while (!EndTimer());
  668. g->Flush(FlushIntentionSync);
  669. GetTimer(&seconds, &iterations);
  670. }
  671. else
  672. {
  673. HBRUSH hbrush = CreateHatchBrush(HS_DIAGCROSS, RGB(0xff, 0, 0));
  674. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  675. SetBkMode(hdc, TRANSPARENT);
  676. StartTimer();
  677. do {
  678. PatBlt(hdc, 0, 0, 512, 512, PATCOPY);
  679. } while (!EndTimer());
  680. GdiFlush();
  681. GetTimer(&seconds, &iterations);
  682. SelectObject(hdc, oldBrush);
  683. DeleteObject(hbrush);
  684. }
  685. UINT pixels = 512 * 512 * iterations;
  686. return(pixels / seconds / MEGA); // Mega-pixels per second
  687. }
  688. float Fill_Rectangle_PerCall_Hatch(Graphics *g, HDC hdc)
  689. {
  690. UINT iterations;
  691. float seconds;
  692. if (!g) return(0); // There is no GDI equivalent
  693. StartTimer();
  694. do {
  695. HatchBrush brush(HatchStyleForwardDiagonal, Color::Red, Color::Black);
  696. g->FillRectangle(&brush, 20, 20, 1, 1);
  697. } while (!EndTimer());
  698. g->Flush(FlushIntentionSync);
  699. GetTimer(&seconds, &iterations);
  700. return(iterations / seconds / KILO); // Kilo-calls per second
  701. }
  702. float Fill_Rectangle_PerPixel_Texture_Big(Graphics *g, HDC hdc)
  703. {
  704. UINT iterations;
  705. float seconds;
  706. if (!g) return(0); // There is no GDI equivalent
  707. Bitmap bitmap(L"winnt256.bmp");
  708. TextureBrush brush(&bitmap);
  709. StartTimer();
  710. do {
  711. g->FillRectangle(&brush, 0, 0, 512, 512);
  712. } while (!EndTimer());
  713. g->Flush(FlushIntentionSync);
  714. GetTimer(&seconds, &iterations);
  715. UINT pixels = 512 * 512 * iterations;
  716. return(pixels / seconds / MEGA); // Mega-pixels per second
  717. }
  718. float Fill_Rectangle_PerPixel_Texture_Small(Graphics *g, HDC hdc)
  719. {
  720. UINT iterations;
  721. float seconds;
  722. if (!g) return(0); // There is no GDI equivalent
  723. Bitmap bitmap(L"winnt256.bmp");
  724. Bitmap texture(32, 32, PixelFormat32bppRGB);
  725. Graphics gTexture(&texture);
  726. gTexture.DrawImage(&bitmap, Rect(0, 0, 32, 32));
  727. TextureBrush brush(&texture);
  728. StartTimer();
  729. do {
  730. g->FillRectangle(&brush, 0, 0, 512, 512);
  731. } while (!EndTimer());
  732. g->Flush(FlushIntentionSync);
  733. GetTimer(&seconds, &iterations);
  734. UINT pixels = 512 * 512 * iterations;
  735. return(pixels / seconds / MEGA); // Mega-pixels per second
  736. }
  737. float Fill_Rectangle_PerCall_Texture(Graphics *g, HDC hdc)
  738. {
  739. UINT iterations;
  740. float seconds;
  741. if (!g) return(0); // There is no GDI equivalent
  742. StartTimer();
  743. do {
  744. Bitmap bitmap(L"winnt256.bmp");
  745. TextureBrush brush(&bitmap);
  746. g->FillRectangle(&brush, 20, 20, 1, 1);
  747. } while (!EndTimer());
  748. g->Flush(FlushIntentionSync);
  749. GetTimer(&seconds, &iterations);
  750. return(iterations / seconds / KILO); // Kilo-calls per second
  751. }
  752. float Fill_Rectangle_PerPixel_Texture_Scaled(Graphics *g, HDC hdc)
  753. {
  754. UINT iterations;
  755. float seconds;
  756. if (!g) return(0); // There is no GDI equivalent
  757. Matrix matrix(0.5, 0, 0, 0.5, 0, 0);
  758. Bitmap bitmap(L"winnt256.bmp");
  759. TextureBrush brush(&bitmap);
  760. brush.SetTransform(&matrix);
  761. StartTimer();
  762. do {
  763. g->FillRectangle(&brush, 0, 0, 512, 512);
  764. } while (!EndTimer());
  765. g->Flush(FlushIntentionSync);
  766. GetTimer(&seconds, &iterations);
  767. UINT pixels = 512 * 512 * iterations;
  768. return(pixels / seconds / MEGA); // Mega-pixels per second
  769. }
  770. float Fill_Rectangle_PerCall_Texture_Scaled(Graphics *g, HDC hdc)
  771. {
  772. UINT iterations;
  773. float seconds;
  774. if (!g) return(0); // There is no GDI equivalent
  775. Matrix matrix(0.5, 0, 0, 0.5, 0, 0);
  776. StartTimer();
  777. do {
  778. Bitmap bitmap(L"winnt256.bmp");
  779. TextureBrush brush(&bitmap);
  780. brush.SetTransform(&matrix);
  781. g->FillRectangle(&brush, 20, 20, 1, 1);
  782. } while (!EndTimer());
  783. g->Flush(FlushIntentionSync);
  784. GetTimer(&seconds, &iterations);
  785. return(iterations / seconds / KILO); // Kilo-calls per second
  786. }
  787. float Fill_Rectangle_PerPixel_Texture_Rotated(Graphics *g, HDC hdc)
  788. {
  789. UINT iterations;
  790. float seconds;
  791. if (!g) return(0); // There is no GDI equivalent
  792. Matrix matrix(0.707f, 0.707f, -0.707f, 0.707f, 0, 0);
  793. Bitmap bitmap(L"winnt256.bmp");
  794. TextureBrush brush(&bitmap);
  795. brush.SetTransform(&matrix);
  796. StartTimer();
  797. do {
  798. g->FillRectangle(&brush, 0, 0, 512, 512);
  799. } while (!EndTimer());
  800. g->Flush(FlushIntentionSync);
  801. GetTimer(&seconds, &iterations);
  802. UINT pixels = 512 * 512 * iterations;
  803. return(pixels / seconds / MEGA); // Mega-pixels per second
  804. }
  805. float Fill_Rectangle_PerCall_Texture_Rotated(Graphics *g, HDC hdc)
  806. {
  807. UINT iterations;
  808. float seconds;
  809. if (!g) return(0); // There is no GDI equivalent
  810. Matrix matrix(0.707f, 0.707f, -0.707f, 0.707f, 0, 0);
  811. StartTimer();
  812. do {
  813. Bitmap bitmap(L"winnt256.bmp");
  814. TextureBrush brush(&bitmap);
  815. brush.SetTransform(&matrix);
  816. g->FillRectangle(&brush, 20, 20, 1, 1);
  817. } while (!EndTimer());
  818. g->Flush(FlushIntentionSync);
  819. GetTimer(&seconds, &iterations);
  820. return(iterations / seconds / KILO); // Kilo-calls per second
  821. }
  822. #if !USE_NEW_APIS
  823. float Fill_Rectangle_PerPixel_RectangleGradient(Graphics *g, HDC hdc)
  824. {
  825. UINT iterations;
  826. float seconds;
  827. if (!g) return(0); // There is no GDI equivalent
  828. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  829. RectangleGradientBrush brush(RectF(0, 0, 512, 512), colors, WrapModeClamp);
  830. StartTimer();
  831. do {
  832. g->FillRectangle(&brush, 0, 0, 512, 512);
  833. } while (!EndTimer());
  834. g->Flush(FlushIntentionSync);
  835. GetTimer(&seconds, &iterations);
  836. UINT pixels = 512 * 512 * iterations;
  837. return(pixels / seconds / MEGA); // Mega-pixels per second
  838. }
  839. float Fill_Rectangle_PerCall_RectangleGradient(Graphics *g, HDC hdc)
  840. {
  841. UINT iterations;
  842. float seconds;
  843. if (!g) return(0); // There is no GDI equivalent
  844. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  845. StartTimer();
  846. do {
  847. RectangleGradientBrush brush(RectF(0, 0, 512, 512), colors, WrapModeClamp);
  848. g->FillRectangle(&brush, 20, 20, 1, 1);
  849. } while (!EndTimer());
  850. g->Flush(FlushIntentionSync);
  851. GetTimer(&seconds, &iterations);
  852. return(iterations / seconds / KILO); // Kilo-calls per second
  853. }
  854. float Fill_Rectangle_PerPixel_RectangleGradient_BlendFactors(Graphics *g, HDC hdc)
  855. {
  856. UINT iterations;
  857. float seconds;
  858. if (!g) return(0); // There is no GDI equivalent
  859. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  860. REAL blendFactors[] = { 0.0f, 0.0168160f, 0.0333130f, 0.0844290f, 0.139409f,
  861. 0.210211f, 0.295801f, 0.393017f, 0.5f, 0.606983f,
  862. 1.0f };
  863. REAL blendPositions[] = { 0.0f, 0.0625f, 0.125f, 0.1875f, 0.25f,
  864. 0.3125f, 0.375f, 0.4375f, 0.5f, 0.5625f,
  865. 1.0f };
  866. RectangleGradientBrush brush(RectF(0, 0, 512, 512), colors, WrapModeClamp);
  867. brush.SetHorizontalBlend(blendFactors, blendPositions, 11);
  868. StartTimer();
  869. do {
  870. g->FillRectangle(&brush, 0, 0, 512, 512);
  871. } while (!EndTimer());
  872. g->Flush(FlushIntentionSync);
  873. GetTimer(&seconds, &iterations);
  874. UINT pixels = 512 * 512 * iterations;
  875. return(pixels / seconds / MEGA); // Mega-pixels per second
  876. }
  877. float Fill_Rectangle_PerCall_RectangleGradient_BlendFactors(Graphics *g, HDC hdc)
  878. {
  879. UINT iterations;
  880. float seconds;
  881. if (!g) return(0); // There is no GDI equivalent
  882. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  883. REAL blendFactors[] = { 0.0f, 0.0168160f, 0.0333130f, 0.0844290f, 0.139409f,
  884. 0.210211f, 0.295801f, 0.393017f, 0.5f, 0.606983f,
  885. 1.0f };
  886. REAL blendPositions[] = { 0.0f, 0.0625f, 0.125f, 0.1875f, 0.25f,
  887. 0.3125f, 0.375f, 0.4375f, 0.5f, 0.5625f,
  888. 1.0f };
  889. StartTimer();
  890. do {
  891. RectangleGradientBrush brush(RectF(0, 0, 512, 512), colors, WrapModeClamp);
  892. brush.SetHorizontalBlend(blendFactors, blendPositions, 11);
  893. g->FillRectangle(&brush, 20, 20, 1, 1);
  894. } while (!EndTimer());
  895. g->Flush(FlushIntentionSync);
  896. GetTimer(&seconds, &iterations);
  897. return(iterations / seconds / KILO); // Kilo-calls per second
  898. }
  899. float Fill_Rectangle_PerPixel_RadialGradient(Graphics *g, HDC hdc)
  900. {
  901. UINT iterations;
  902. float seconds;
  903. if (!g) return(0); // There is no GDI equivalent
  904. RadialGradientBrush brush(RectF(0, 0, 512, 512), Color::Black, Color::Red, WrapModeTile);
  905. StartTimer();
  906. do {
  907. g->FillRectangle(&brush, 0, 0, 512, 512);
  908. } while (!EndTimer());
  909. g->Flush(FlushIntentionSync);
  910. GetTimer(&seconds, &iterations);
  911. UINT pixels = 512 * 512 * iterations;
  912. return(pixels / seconds / MEGA); // Mega-pixels per second
  913. }
  914. float Fill_Rectangle_PerCall_RadialGradient(Graphics *g, HDC hdc)
  915. {
  916. UINT iterations;
  917. float seconds;
  918. if (!g) return(0); // There is no GDI equivalent
  919. StartTimer();
  920. do {
  921. RadialGradientBrush brush(RectF(0, 0, 512, 512), Color::Black, Color::Red, WrapModeTile);
  922. g->FillRectangle(&brush, 20, 20, 1, 1);
  923. } while (!EndTimer());
  924. g->Flush(FlushIntentionSync);
  925. GetTimer(&seconds, &iterations);
  926. return(iterations / seconds / KILO); // Kilo-calls per second
  927. }
  928. #endif
  929. float Fill_Rectangle_PerPixel_LinearGradient(Graphics *g, HDC hdc)
  930. {
  931. UINT iterations;
  932. float seconds;
  933. if (!g) return(0); // There is no GDI equivalent
  934. // LinearGradientBrush brush(PointF(128, 128), PointF(256, 256),
  935. // Color::Red, Color::Black, WrapModeTileFlipX);
  936. LinearGradientBrush brush(PointF(0, 0), PointF(512, 512), Color::Red, Color::Black);
  937. StartTimer();
  938. do {
  939. g->FillRectangle(&brush, 0, 0, 512, 512);
  940. } while (!EndTimer());
  941. g->Flush(FlushIntentionSync);
  942. GetTimer(&seconds, &iterations);
  943. UINT pixels = 512 * 512 * iterations;
  944. return(pixels / seconds / MEGA); // Mega-pixels per second
  945. }
  946. float Fill_Rectangle_PerCall_LinearGradient(Graphics *g, HDC hdc)
  947. {
  948. UINT iterations;
  949. float seconds;
  950. if (!g) return(0); // There is no GDI equivalent
  951. StartTimer();
  952. do {
  953. LinearGradientBrush brush(PointF(0, 0), PointF(512, 512), Color::Red, Color::Black);
  954. g->FillRectangle(&brush, 20, 20, 1, 1);
  955. } while (!EndTimer());
  956. g->Flush(FlushIntentionSync);
  957. GetTimer(&seconds, &iterations);
  958. return(iterations / seconds / KILO); // Kilo-calls per second
  959. }
  960. float Fill_Rectangle_PerPixel_LinearGradient_PresetColors(Graphics *g, HDC hdc)
  961. {
  962. UINT iterations;
  963. float seconds;
  964. INT i;
  965. if (!g) return(0); // There is no GDI equivalent
  966. Color colors[12];
  967. REAL blendPositions[] = { 0.0f, 0.0625f, 0.125f, 0.1875f, 0.25f,
  968. 0.3125f, 0.375f, 0.4375f, 0.5f, 0.5625f,
  969. 1.0f };
  970. for (i = 0; i < 12; i += 2)
  971. {
  972. colors[i] = Color::Red;
  973. colors[i + 1] = Color::Black;
  974. }
  975. LinearGradientBrush brush(PointF(0, 0), PointF(512, 512), Color::Red, Color::Black);
  976. brush.SetInterpolationColors(colors, blendPositions, 11);
  977. StartTimer();
  978. do {
  979. g->FillRectangle(&brush, 0, 0, 512, 512);
  980. } while (!EndTimer());
  981. g->Flush(FlushIntentionSync);
  982. GetTimer(&seconds, &iterations);
  983. UINT pixels = 512 * 512 * iterations;
  984. return(pixels / seconds / MEGA); // Mega-pixels per second
  985. }
  986. float Fill_Rectangle_PerCall_LinearGradient_PresetColors(Graphics *g, HDC hdc)
  987. {
  988. UINT iterations;
  989. float seconds;
  990. INT i;
  991. if (!g) return(0); // There is no GDI equivalent
  992. Color colors[12];
  993. REAL blendPositions[] = { 0.0f, 0.0625f, 0.125f, 0.1875f, 0.25f,
  994. 0.3125f, 0.375f, 0.4375f, 0.5f, 0.5625f,
  995. 1.0f };
  996. for (i = 0; i < 12; i += 2)
  997. {
  998. colors[i] = Color::Red;
  999. colors[i + 1] = Color::Black;
  1000. }
  1001. StartTimer();
  1002. do {
  1003. LinearGradientBrush brush(PointF(0, 0), PointF(512, 512), Color::Red, Color::Black);
  1004. brush.SetInterpolationColors(colors, blendPositions, 11);
  1005. g->FillRectangle(&brush, 20, 20, 1, 1);
  1006. } while (!EndTimer());
  1007. g->Flush(FlushIntentionSync);
  1008. GetTimer(&seconds, &iterations);
  1009. return(iterations / seconds / KILO); // Kilo-calls per second
  1010. }
  1011. float Fill_Rectangle_PerPixel_LinearGradient_BlendFactors(Graphics *g, HDC hdc)
  1012. {
  1013. UINT iterations;
  1014. float seconds;
  1015. if (!g) return(0); // There is no GDI equivalent
  1016. REAL blendFactors[] = { 0.0f, 0.0168160f, 0.0333130f, 0.0844290f, 0.139409f,
  1017. 0.210211f, 0.295801f, 0.393017f, 0.5f, 0.606983f,
  1018. 1.0f };
  1019. REAL blendPositions[] = { 0.0f, 0.0625f, 0.125f, 0.1875f, 0.25f,
  1020. 0.3125f, 0.375f, 0.4375f, 0.5f, 0.5625f,
  1021. 1.0f };
  1022. LinearGradientBrush brush(PointF(0, 0), PointF(512, 512), Color::Red, Color::Black);
  1023. brush.SetBlend(blendFactors, blendPositions, 11);
  1024. StartTimer();
  1025. do {
  1026. g->FillRectangle(&brush, 0, 0, 512, 512);
  1027. } while (!EndTimer());
  1028. g->Flush(FlushIntentionSync);
  1029. GetTimer(&seconds, &iterations);
  1030. UINT pixels = 512 * 512 * iterations;
  1031. return(pixels / seconds / MEGA); // Mega-pixels per second
  1032. }
  1033. float Fill_Rectangle_PerCall_LinearGradient_BlendFactors(Graphics *g, HDC hdc)
  1034. {
  1035. UINT iterations;
  1036. float seconds;
  1037. if (!g) return(0); // There is no GDI equivalent
  1038. REAL blendFactors[] = { 0.0f, 0.0168160f, 0.0333130f, 0.0844290f, 0.139409f,
  1039. 0.210211f, 0.295801f, 0.393017f, 0.5f, 0.606983f,
  1040. 1.0f };
  1041. REAL blendPositions[] = { 0.0f, 0.0625f, 0.125f, 0.1875f, 0.25f,
  1042. 0.3125f, 0.375f, 0.4375f, 0.5f, 0.5625f,
  1043. 1.0f };
  1044. StartTimer();
  1045. do {
  1046. LinearGradientBrush brush(PointF(0, 0), PointF(512, 512), Color::Red, Color::Black);
  1047. brush.SetBlend(blendFactors, blendPositions, 11);
  1048. g->FillRectangle(&brush, 20, 20, 1, 1);
  1049. } while (!EndTimer());
  1050. g->Flush(FlushIntentionSync);
  1051. GetTimer(&seconds, &iterations);
  1052. return(iterations / seconds / KILO); // Kilo-calls per second
  1053. }
  1054. float Fill_Rectangle_PerPixel_PathGradient(Graphics *g, HDC hdc)
  1055. {
  1056. UINT iterations;
  1057. float seconds;
  1058. if (!g) return(0); // There is no GDI equivalent
  1059. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1060. Color colors[] = { Color::Red, Color::Red, Color::Red, Color::Red };
  1061. INT count = 4;
  1062. PathGradientBrush brush(points, 4);
  1063. brush.SetCenterColor(Color::Black);
  1064. brush.SetSurroundColors(colors, &count);
  1065. StartTimer();
  1066. do {
  1067. g->FillRectangle(&brush, 0, 0, 512, 512);
  1068. } while (!EndTimer());
  1069. g->Flush(FlushIntentionSync);
  1070. GetTimer(&seconds, &iterations);
  1071. UINT pixels = 512 * 512 * iterations;
  1072. return(pixels / seconds / MEGA); // Mega-pixels per second
  1073. }
  1074. float Fill_Rectangle_PerCall_PathGradient(Graphics *g, HDC hdc)
  1075. {
  1076. UINT iterations;
  1077. float seconds;
  1078. if (!g) return(0); // There is no GDI equivalent
  1079. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1080. Color colors[] = { Color::Red, Color::Red, Color::Red, Color::Red };
  1081. INT count = 4;
  1082. StartTimer();
  1083. do {
  1084. PathGradientBrush brush(points, 4);
  1085. brush.SetCenterColor(Color::Black);
  1086. brush.SetSurroundColors(colors, &count);
  1087. g->FillRectangle(&brush, 20, 20, 1, 1);
  1088. } while (!EndTimer());
  1089. g->Flush(FlushIntentionSync);
  1090. GetTimer(&seconds, &iterations);
  1091. return(iterations / seconds / KILO); // Kilo-calls per second
  1092. }
  1093. float Fill_Rectangle_PerPixel_PathGradient_LotsaTriangles(Graphics *g, HDC hdc)
  1094. {
  1095. UINT iterations;
  1096. INT count;
  1097. INT i;
  1098. float seconds;
  1099. float pi;
  1100. float angle;
  1101. if (!g) return(0); // There is no GDI equivalent
  1102. PointF points[50];
  1103. Color colors[50];
  1104. pi = static_cast<float>(acos(-1.0f));
  1105. for (angle = 0, count = 0; angle < 2*pi; angle += (pi / 20), count++)
  1106. {
  1107. points[count].X = 256 + 512 * static_cast<float>(cos(angle));
  1108. points[count].Y = 256 + 512 * static_cast<float>(sin(angle));
  1109. }
  1110. for (i = 0; i < count; i++)
  1111. {
  1112. colors[i] = Color::Red;
  1113. }
  1114. PathGradientBrush brush(points, count);
  1115. brush.SetCenterColor(Color::Black);
  1116. brush.SetSurroundColors(colors, &count);
  1117. StartTimer();
  1118. do {
  1119. g->FillRectangle(&brush, 0, 0, 512, 512);
  1120. } while (!EndTimer());
  1121. g->Flush(FlushIntentionSync);
  1122. GetTimer(&seconds, &iterations);
  1123. UINT pixels = 512 * 512 * iterations;
  1124. return(pixels / seconds / MEGA); // Mega-pixels per second
  1125. }
  1126. float Fill_Rectangle_PerCall_PathGradient_LotsaTriangles(Graphics *g, HDC hdc)
  1127. {
  1128. UINT iterations;
  1129. INT count;
  1130. INT i;
  1131. float seconds;
  1132. float pi;
  1133. float angle;
  1134. if (!g) return(0); // There is no GDI equivalent
  1135. PointF points[50];
  1136. Color colors[50];
  1137. pi = static_cast<float>(acos(-1.0f));
  1138. for (angle = 0, count = 0; angle < 2*pi; angle += (pi / 20), count++)
  1139. {
  1140. points[count].X = 256 + 512 * static_cast<float>(cos(angle));
  1141. points[count].Y = 256 + 512 * static_cast<float>(sin(angle));
  1142. }
  1143. for (i = 0; i < count; i++)
  1144. {
  1145. colors[i] = Color::Red;
  1146. }
  1147. StartTimer();
  1148. do {
  1149. PathGradientBrush brush(points, count);
  1150. brush.SetCenterColor(Color::Black);
  1151. brush.SetSurroundColors(colors, &count);
  1152. g->FillRectangle(&brush, 20, 20, 1, 1);
  1153. } while (!EndTimer());
  1154. g->Flush(FlushIntentionSync);
  1155. GetTimer(&seconds, &iterations);
  1156. return(iterations / seconds / KILO); // Kilo-calls per second
  1157. }
  1158. float Fill_Rectangle_PerPixel_PathGradient_Scaled(Graphics *g, HDC hdc)
  1159. {
  1160. UINT iterations;
  1161. float seconds;
  1162. if (!g) return(0); // There is no GDI equivalent
  1163. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1164. Color colors[] = { Color::Red, Color::Red, Color::Red, Color::Red };
  1165. INT count = 4;
  1166. PathGradientBrush brush(points, 4);
  1167. brush.SetCenterColor(Color::Black);
  1168. brush.SetSurroundColors(colors, &count);
  1169. brush.SetFocusScales(0.2f, 0.2f);
  1170. brush.SetCenterPoint(PointF(200, 200));
  1171. StartTimer();
  1172. do {
  1173. g->FillRectangle(&brush, 0, 0, 512, 512);
  1174. } while (!EndTimer());
  1175. g->Flush(FlushIntentionSync);
  1176. GetTimer(&seconds, &iterations);
  1177. UINT pixels = 512 * 512 * iterations;
  1178. return(pixels / seconds / MEGA); // Mega-pixels per second
  1179. }
  1180. float Fill_Rectangle_PerCall_PathGradient_Scaled(Graphics *g, HDC hdc)
  1181. {
  1182. UINT iterations;
  1183. float seconds;
  1184. if (!g) return(0); // There is no GDI equivalent
  1185. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1186. Color colors[] = { Color::Red, Color::Red, Color::Red, Color::Red };
  1187. INT count = 4;
  1188. StartTimer();
  1189. do {
  1190. PathGradientBrush brush(points, 4);
  1191. brush.SetCenterColor(Color::Black);
  1192. brush.SetSurroundColors(colors, &count);
  1193. brush.SetFocusScales(0.2f, 0.2f);
  1194. brush.SetCenterPoint(PointF(200, 200));
  1195. g->FillRectangle(&brush, 20, 20, 1, 1);
  1196. } while (!EndTimer());
  1197. g->Flush(FlushIntentionSync);
  1198. GetTimer(&seconds, &iterations);
  1199. return(iterations / seconds / KILO); // Kilo-calls per second
  1200. }
  1201. float Fill_Rectangle_PerPixel_PathGradient_Multicolored(Graphics *g, HDC hdc)
  1202. {
  1203. UINT iterations;
  1204. float seconds;
  1205. if (!g) return(0); // There is no GDI equivalent
  1206. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1207. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  1208. INT count = 4;
  1209. PathGradientBrush brush(points, 4);
  1210. brush.SetCenterColor(Color::Black);
  1211. brush.SetSurroundColors(colors, &count);
  1212. StartTimer();
  1213. do {
  1214. g->FillRectangle(&brush, 0, 0, 512, 512);
  1215. } while (!EndTimer());
  1216. g->Flush(FlushIntentionSync);
  1217. GetTimer(&seconds, &iterations);
  1218. UINT pixels = 512 * 512 * iterations;
  1219. return(pixels / seconds / MEGA); // Mega-pixels per second
  1220. }
  1221. float Fill_Rectangle_PerCall_PathGradient_Multicolored(Graphics *g, HDC hdc)
  1222. {
  1223. UINT iterations;
  1224. float seconds;
  1225. if (!g) return(0); // There is no GDI equivalent
  1226. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1227. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  1228. INT count = 4;
  1229. StartTimer();
  1230. do {
  1231. PathGradientBrush brush(points, 4);
  1232. brush.SetCenterColor(Color::Black);
  1233. brush.SetSurroundColors(colors, &count);
  1234. g->FillRectangle(&brush, 20, 20, 1, 1);
  1235. } while (!EndTimer());
  1236. g->Flush(FlushIntentionSync);
  1237. GetTimer(&seconds, &iterations);
  1238. return(iterations / seconds / KILO); // Kilo-calls per second
  1239. }
  1240. float Fill_Rectangle_PerPixel_PathGradient_Multicolored_LotsaTriangles(Graphics *g, HDC hdc)
  1241. {
  1242. UINT iterations;
  1243. INT count;
  1244. INT i;
  1245. float seconds;
  1246. float pi;
  1247. float angle;
  1248. if (!g) return(0); // There is no GDI equivalent
  1249. PointF points[50];
  1250. Color colors[50];
  1251. pi = static_cast<float>(acos(-1.0f));
  1252. // Create 40 points:
  1253. for (angle = 0, count = 0; angle < 2*pi; angle += (pi / 20), count++)
  1254. {
  1255. points[count].X = 256 + 512 * static_cast<float>(cos(angle));
  1256. points[count].Y = 256 + 512 * static_cast<float>(sin(angle));
  1257. }
  1258. for (i = 0; i < count; i += 2)
  1259. {
  1260. colors[i] = Color::Red;
  1261. colors[i + 1] = Color::Blue;
  1262. }
  1263. PathGradientBrush brush(points, count);
  1264. brush.SetCenterColor(Color::Black);
  1265. brush.SetSurroundColors(colors, &count);
  1266. StartTimer();
  1267. do {
  1268. g->FillRectangle(&brush, 0, 0, 512, 512);
  1269. } while (!EndTimer());
  1270. g->Flush(FlushIntentionSync);
  1271. GetTimer(&seconds, &iterations);
  1272. UINT pixels = 512 * 512 * iterations;
  1273. return(pixels / seconds / MEGA); // Mega-pixels per second
  1274. }
  1275. float Fill_Rectangle_PathGradient_Multicolored_LotsaTriangles(Graphics *g, HDC hdc)
  1276. {
  1277. UINT iterations;
  1278. INT count;
  1279. INT i;
  1280. float seconds;
  1281. float pi;
  1282. float angle;
  1283. if (!g) return(0); // There is no GDI equivalent
  1284. PointF points[50];
  1285. Color colors[50];
  1286. pi = static_cast<float>(acos(-1.0f));
  1287. // Create 40 points:
  1288. for (angle = 0, count = 0; angle < 2*pi; angle += (pi / 20), count++)
  1289. {
  1290. points[count].X = 256 + 512 * static_cast<float>(cos(angle));
  1291. points[count].Y = 256 + 512 * static_cast<float>(sin(angle));
  1292. }
  1293. for (i = 0; i < count; i += 2)
  1294. {
  1295. colors[i] = Color::Red;
  1296. colors[i + 1] = Color::Blue;
  1297. }
  1298. StartTimer();
  1299. do {
  1300. PathGradientBrush brush(points, count);
  1301. brush.SetCenterColor(Color::Black);
  1302. brush.SetSurroundColors(colors, &count);
  1303. g->FillRectangle(&brush, 20, 20, 1, 1);
  1304. } while (!EndTimer());
  1305. g->Flush(FlushIntentionSync);
  1306. GetTimer(&seconds, &iterations);
  1307. return(iterations / seconds / KILO); // Kilo-calls per second
  1308. }
  1309. float Fill_Rectangle_PerPixel_PathGradient_Multicolored_Scaled(Graphics *g, HDC hdc)
  1310. {
  1311. UINT iterations;
  1312. float seconds;
  1313. if (!g) return(0); // There is no GDI equivalent
  1314. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1315. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  1316. INT count = 4;
  1317. PathGradientBrush brush(points, 4);
  1318. brush.SetCenterColor(Color::Black);
  1319. brush.SetSurroundColors(colors, &count);
  1320. brush.SetFocusScales(0.2f, 0.2f);
  1321. brush.SetCenterPoint(PointF(200, 200));
  1322. StartTimer();
  1323. do {
  1324. g->FillRectangle(&brush, 0, 0, 512, 512);
  1325. } while (!EndTimer());
  1326. g->Flush(FlushIntentionSync);
  1327. GetTimer(&seconds, &iterations);
  1328. UINT pixels = 512 * 512 * iterations;
  1329. return(pixels / seconds / MEGA); // Mega-pixels per second
  1330. }
  1331. float Fill_Rectangle_PerCall_PathGradient_Multicolored_Scaled(Graphics *g, HDC hdc)
  1332. {
  1333. UINT iterations;
  1334. float seconds;
  1335. if (!g) return(0); // There is no GDI equivalent
  1336. PointF points[] = { PointF(0, 0), PointF(0, 512), PointF(512, 512), PointF(512, 0) };
  1337. Color colors[] = { Color::Red, Color::Green, Color::Blue, Color::Black };
  1338. INT count = 4;
  1339. StartTimer();
  1340. do {
  1341. PathGradientBrush brush(points, 4);
  1342. brush.SetCenterColor(Color::Black);
  1343. brush.SetSurroundColors(colors, &count);
  1344. brush.SetFocusScales(0.2f, 0.2f);
  1345. brush.SetCenterPoint(PointF(200, 200));
  1346. g->FillRectangle(&brush, 20, 20, 1, 1);
  1347. } while (!EndTimer());
  1348. g->Flush(FlushIntentionSync);
  1349. GetTimer(&seconds, &iterations);
  1350. return(iterations / seconds / KILO); // Kilo-calls per second
  1351. }
  1352. float Fill_Path_PerCall_Solid_Complex_Aliased(Graphics *g, HDC hdc)
  1353. {
  1354. UINT iterations;
  1355. float seconds;
  1356. FontFamily family(L"Times New Roman");
  1357. GraphicsPath path(FillModeWinding);
  1358. PointF origin1(20, 20);
  1359. path.AddString(L"GDI+", wcslen(L"GDI+"), &family, 0, 200,
  1360. origin1, NULL);
  1361. PointF origin2(20, 220);
  1362. path.AddString(L"Rocks!", wcslen(L"Rocks!"), &family, FontStyleItalic, 200,
  1363. origin2, NULL);
  1364. if (g)
  1365. {
  1366. SolidBrush brush(Color::Silver);
  1367. StartTimer();
  1368. do {
  1369. g->FillPath(&brush, &path);
  1370. } while (!EndTimer());
  1371. g->Flush(FlushIntentionSync);
  1372. GetTimer(&seconds, &iterations);
  1373. }
  1374. else
  1375. {
  1376. PathData pathData;
  1377. INT i;
  1378. INT count = path.GetPointCount();
  1379. PointF *pointF = new PointF[count];
  1380. BYTE *types = new BYTE[count];
  1381. POINT *point = new POINT[count];
  1382. // ACK - these should NOT be public!
  1383. pathData.Points = pointF;
  1384. pathData.Types = types;
  1385. pathData.Count = count;
  1386. path.GetPathData(&pathData);
  1387. for (i = 0; i < count; i++)
  1388. {
  1389. point[i].x = (INT) (pointF[i].X + 0.5f);
  1390. point[i].y = (INT) (pointF[i].Y + 0.5f);
  1391. }
  1392. for (i = 0; i < count; i++)
  1393. {
  1394. BYTE type = types[i] & PathPointTypePathTypeMask;
  1395. if (type == PathPointTypeStart)
  1396. type = PT_MOVETO;
  1397. else if (type == PathPointTypeLine)
  1398. type = PT_LINETO;
  1399. else if (type == PathPointTypeBezier)
  1400. type = PT_BEZIERTO;
  1401. else
  1402. {
  1403. ASSERT(FALSE);
  1404. }
  1405. if (types[i] & PathPointTypeCloseSubpath)
  1406. type |= PT_CLOSEFIGURE;
  1407. types[i] = type;
  1408. }
  1409. HBRUSH hbrush = CreateSolidBrush(RGB(255, 0, 0));
  1410. HGDIOBJ oldBrush = SelectObject(hdc, hbrush);
  1411. HGDIOBJ hpen = GetStockObject(NULL_PEN);
  1412. HGDIOBJ oldPen = SelectObject(hdc, hpen);
  1413. BeginPath(hdc);
  1414. PolyDraw(hdc, point, types, count);
  1415. EndPath(hdc);
  1416. StartTimer();
  1417. do {
  1418. SaveDC(hdc);
  1419. FillPath(hdc);
  1420. RestoreDC(hdc, -1);
  1421. } while (!EndTimer());
  1422. AbortPath(hdc);
  1423. GdiFlush();
  1424. GetTimer(&seconds, &iterations);
  1425. SelectObject(hdc, oldBrush);
  1426. DeleteObject(hbrush);
  1427. SelectObject(hdc, oldPen);
  1428. DeleteObject(hpen);
  1429. // Clear these so that the PathData destructor doesn't cause trouble...
  1430. pathData.Points = NULL;
  1431. pathData.Types = NULL;
  1432. pathData.Count = 0;
  1433. delete[] pointF;
  1434. delete[] types;
  1435. delete[] point;
  1436. }
  1437. return(iterations / seconds / KILO); // Kilo-calls per second
  1438. }
  1439. float Fill_Path_PerCall_Solid_Complex_Antialiased(Graphics *g, HDC hdc)
  1440. {
  1441. UINT iterations;
  1442. float seconds;
  1443. if (!g) return(0); // There is no GDI equivalent
  1444. g->SetSmoothingMode(SmoothingModeAntiAlias);
  1445. FontFamily family(L"Times New Roman");
  1446. GraphicsPath path(FillModeWinding);
  1447. PointF origin1(20, 20);
  1448. path.AddString(L"GDI+", wcslen(L"GDI+"), &family, 0, 200,
  1449. origin1, NULL);
  1450. PointF origin2(20, 220);
  1451. path.AddString(L"Rocks!", wcslen(L"Rocks!"), &family, FontStyleItalic, 200,
  1452. origin2, NULL);
  1453. SolidBrush brush(Color::Silver);
  1454. StartTimer();
  1455. do {
  1456. g->FillPath(&brush, &path);
  1457. } while (!EndTimer());
  1458. g->Flush(FlushIntentionSync);
  1459. GetTimer(&seconds, &iterations);
  1460. return(iterations / seconds / KILO); // Kilo-calls per second
  1461. }
  1462. float Fill_Path_PerCall_Solid_Complex_Antialiased_Transparent(Graphics *g, HDC hdc)
  1463. {
  1464. UINT iterations;
  1465. float seconds;
  1466. if (!g) return(0); // There is no GDI equivalent
  1467. g->SetSmoothingMode(SmoothingModeAntiAlias);
  1468. FontFamily family(L"Times New Roman");
  1469. GraphicsPath path(FillModeWinding);
  1470. PointF origin1(20, 20);
  1471. path.AddString(L"GDI+", wcslen(L"GDI+"), &family, 0, 200,
  1472. origin1, NULL);
  1473. PointF origin2(20, 220);
  1474. path.AddString(L"Rocks!", wcslen(L"Rocks!"), &family, FontStyleItalic, 200,
  1475. origin2, NULL);
  1476. SolidBrush brush(Color(0x80, 0xff, 0, 0));
  1477. StartTimer();
  1478. do {
  1479. g->FillPath(&brush, &path);
  1480. } while (!EndTimer());
  1481. g->Flush(FlushIntentionSync);
  1482. GetTimer(&seconds, &iterations);
  1483. return(iterations / seconds / KILO); // Kilo-calls per second
  1484. }
  1485. ////////////////////////////////////////////////////////////////////////////////
  1486. // Add tests for this file here. Always use the 'T' macro for adding entries.
  1487. // The parameter meanings are as follows:
  1488. //
  1489. // Parameter
  1490. // ---------
  1491. // 1 UniqueIdentifier - Must be a unique number assigned to no other test
  1492. // 2 Priority - On a scale of 1 to 5, how important is the test?
  1493. // 3 Function - Function name
  1494. // 4 Comment - Anything to describe the test
  1495. Test FillTests[] =
  1496. {
  1497. T(3000, 1, Fill_Rectangle_PerPixel_Solid_Opaque_Aliased , "Mpixels/s"),
  1498. T(3001, 1, Fill_Rectangle_PerCall_Solid_Opaque_Aliased , "Kcalls/s"),
  1499. T(3002, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased , "Mpixels/s"),
  1500. T(3003, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_CompatibleDIB , "Mpixels/s"),
  1501. T(3004, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_15bpp , "Mpixels/s"),
  1502. T(3005, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_16bpp , "Mpixels/s"),
  1503. T(3006, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_24bpp , "Mpixels/s"),
  1504. T(3007, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Aliased_Bitmap_32bpp , "Mpixels/s"),
  1505. T(3008, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased , "Mpixels/s"),
  1506. T(3009, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Quality , "Mpixels/s"),
  1507. T(3010, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_CompatibleDIB , "Mpixels/s"),
  1508. T(3011, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_15bpp , "Mpixels/s"),
  1509. T(3012, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_16bpp , "Mpixels/s"),
  1510. T(3013, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_24bpp , "Mpixels/s"),
  1511. T(3014, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Aliased_Bitmap_32bpp , "Mpixels/s"),
  1512. T(3015, 1, Fill_Trapezoid_PerCall_Solid_Opaque_Aliased , "Kcalls/s"),
  1513. T(3016, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Antialiased , "Mpixels/s"),
  1514. T(3017, 1, Fill_Trapezoid_PerCall_Solid_Opaque_Antialiased , "Kcalls/s"),
  1515. T(3018, 1, Fill_Trapezoid_PerPixel_Solid_Transparent_Antialiased , "Mpixels/s"),
  1516. T(3019, 1, Fill_Trapezoid_PerCall_Solid_Transparent_Antialiased , "Kcalls/s"),
  1517. T(3020, 1, Fill_Rectangle_PerPixel_Hatch_Opaque , "Mpixels/s"),
  1518. T(3021, 1, Fill_Rectangle_PerCall_Hatch , "Kcalls/s"),
  1519. T(3022, 1, Fill_Rectangle_PerPixel_Texture_Big , "Mpixels/s"),
  1520. T(3023, 1, Fill_Rectangle_PerCall_Texture , "Kcalls/s"),
  1521. T(3024, 1, Fill_Rectangle_PerPixel_Texture_Scaled , "Mpixels/s"),
  1522. T(3025, 1, Fill_Rectangle_PerCall_Texture_Scaled , "Kcalls/s"),
  1523. T(3026, 1, Fill_Rectangle_PerPixel_Texture_Rotated , "Mpixels/s"),
  1524. T(3027, 1, Fill_Rectangle_PerCall_Texture_Rotated , "Kcalls/s"),
  1525. #if !USE_NEW_APIS
  1526. T(3028, 1, Fill_Rectangle_PerPixel_RectangleGradient , "Mpixels/s"),
  1527. T(3029, 1, Fill_Rectangle_PerCall_RectangleGradient , "Kcalls/s"),
  1528. T(3030, 1, Fill_Rectangle_PerPixel_RectangleGradient_BlendFactors , "Mpixels/s"),
  1529. T(3031, 1, Fill_Rectangle_PerCall_RectangleGradient_BlendFactors , "Kcalls/s"),
  1530. T(3038, 1, Fill_Rectangle_PerPixel_RadialGradient , "Mpixels/s"),
  1531. T(3039, 1, Fill_Rectangle_PerCall_RadialGradient , "Kcalls/s"),
  1532. #endif
  1533. T(3032, 1, Fill_Rectangle_PerPixel_LinearGradient , "Mpixels/s"),
  1534. T(3033, 1, Fill_Rectangle_PerCall_LinearGradient , "Kcalls/s"),
  1535. T(3034, 1, Fill_Rectangle_PerPixel_LinearGradient_PresetColors , "Mpixels/s"),
  1536. T(3035, 1, Fill_Rectangle_PerCall_LinearGradient_PresetColors , "Kcalls/s"),
  1537. T(3036, 1, Fill_Rectangle_PerPixel_LinearGradient_BlendFactors , "Mpixels/s"),
  1538. T(3037, 1, Fill_Rectangle_PerCall_LinearGradient_BlendFactors , "Kcalls/s"),
  1539. T(3040, 1, Fill_Rectangle_PerPixel_PathGradient , "Mpixels/s"),
  1540. T(3041, 1, Fill_Rectangle_PerCall_PathGradient , "Kcalls/s"),
  1541. T(3042, 1, Fill_Rectangle_PerPixel_PathGradient_LotsaTriangles , "Mpixels/s"),
  1542. T(3043, 1, Fill_Rectangle_PerCall_PathGradient_LotsaTriangles , "Kcalls/s"),
  1543. T(3044, 1, Fill_Rectangle_PerPixel_PathGradient_Scaled , "Mpixels/s"),
  1544. T(3045, 1, Fill_Rectangle_PerCall_PathGradient_Scaled , "Kcalls/s"),
  1545. T(3046, 1, Fill_Rectangle_PerPixel_PathGradient_Multicolored , "Mpixels/s"),
  1546. T(3047, 1, Fill_Rectangle_PerCall_PathGradient_Multicolored , "Kcalls/s"),
  1547. T(3048, 1, Fill_Rectangle_PerPixel_PathGradient_Multicolored_LotsaTriangles , "Mpixels/s"),
  1548. T(3049, 1, Fill_Rectangle_PathGradient_Multicolored_LotsaTriangles , "Kcalls/s"),
  1549. T(3050, 1, Fill_Rectangle_PerPixel_PathGradient_Multicolored_Scaled , "Mpixels/s"),
  1550. T(3051, 1, Fill_Rectangle_PerCall_PathGradient_Multicolored_Scaled , "Kcalls/s"),
  1551. T(3052, 1, Fill_Trapezoid_PerPixel_Texture_Scaled_Opaque_Antialiased , "Mpixels/s"),
  1552. T(3053, 1, Fill_Trapezoid_PerPixel_Texture_Identity_Opaque_Antialiased , "Mpixels/s"),
  1553. T(3054, 1, Fill_Rectangle_PerPixel_Solid_Opaque_Antialiased_Integer , "Mpixels/s"),
  1554. T(3055, 1, Fill_Rectangle_PerPixel_Solid_Opaque_Antialiased_HalfInteger , "Mpixels/s"),
  1555. T(3056, 1, Fill_Rectangle_PerPixel_Hatch_Transparent , "Mpixels/s"),
  1556. T(3057, 1, Fill_Ellipse_PerCall_Big_Solid , "Mpixels/s"),
  1557. T(3058, 1, Fill_Ellipse_PerCall_Small_Solid , "Mpixels/s"),
  1558. T(3059, 1, Fill_Rectangle_PerPixel_Texture_Small , "Mpixels/s"),
  1559. T(3060, 1, Fill_Path_PerCall_Solid_Complex_Aliased , "Kcalls/s"),
  1560. T(3061, 1, Fill_Path_PerCall_Solid_Complex_Antialiased , "Kcalls/s"),
  1561. T(3062, 1, Fill_Path_PerCall_Solid_Complex_Antialiased_Transparent , "Kcalls/s"),
  1562. T(3063, 1, Fill_Trapezoid_PerPixel_Solid_Opaque_Antialiased_Quality , "Mpixels/s"),
  1563. };
  1564. INT FillTests_Count = sizeof(FillTests) / sizeof(FillTests[0]);