34 EXPECT_FLOAT_EQ(0.0f, rect
.left);
35 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
36 EXPECT_FLOAT_EQ(0.0f, rect
.right);
37 EXPECT_FLOAT_EQ(0.0f, rect
.top);
39 std::vector<CFX_PointF> data;
40 data.emplace_back(0.0f, 0.0f);
42 EXPECT_FLOAT_EQ(0.0f, rect
.left);
43 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
44 EXPECT_FLOAT_EQ(0.0f, rect
.right);
45 EXPECT_FLOAT_EQ(0.0f, rect
.top);
47 EXPECT_FLOAT_EQ(0.0f, rect
.left);
48 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
49 EXPECT_FLOAT_EQ(0.0f, rect
.right);
50 EXPECT_FLOAT_EQ(0.0f, rect
.top);
52 data.emplace_back(2.5f, 6.2f);
53 data.emplace_back(1.5f, 6.2f);
55 EXPECT_FLOAT_EQ(0.0f, rect
.left);
56 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
57 EXPECT_FLOAT_EQ(2.5f, rect
.right);
58 EXPECT_FLOAT_EQ(6.2f, rect
.top);
61 EXPECT_FLOAT_EQ(0.0f, rect
.left);
62 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
63 EXPECT_FLOAT_EQ(2.5f, rect
.right);
64 EXPECT_FLOAT_EQ(6.2f, rect
.top);
66 data.emplace_back(2.5f, 6.3f);
68 EXPECT_FLOAT_EQ(0.0f, rect
.left);
69 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
70 EXPECT_FLOAT_EQ(2.5f, rect
.right);
71 EXPECT_FLOAT_EQ(6.3f, rect
.top);
73 data.emplace_back(-3.0f, 6.3f);
75 EXPECT_FLOAT_EQ(-3.0f, rect
.left);
76 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
77 EXPECT_FLOAT_EQ(2.5f, rect
.right);
78 EXPECT_FLOAT_EQ(6.3f, rect
.top);
80 data.emplace_back(4.0f, -8.0f);
82 EXPECT_FLOAT_EQ(-3.0f, rect
.left);
83 EXPECT_FLOAT_EQ(-8.0f, rect
.bottom);
84 EXPECT_FLOAT_EQ(4.0f, rect
.right);
85 EXPECT_FLOAT_EQ(6.3f, rect
.top);
197 EXPECT_FLOAT_EQ(0.0f, rect
.left);
198 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
199 EXPECT_FLOAT_EQ(0.0f, rect
.right);
200 EXPECT_FLOAT_EQ(0.0f, rect
.top);
204 EXPECT_FLOAT_EQ(-1.0f, rect
.left);
205 EXPECT_FLOAT_EQ(-3.0f, rect
.bottom);
206 EXPECT_FLOAT_EQ(4.5f, rect
.right);
207 EXPECT_FLOAT_EQ(3.2f, rect
.top);
210 EXPECT_FLOAT_EQ(-4.5f, rect
.left);
211 EXPECT_FLOAT_EQ(-3.2f, rect
.bottom);
212 EXPECT_FLOAT_EQ(1.0f, rect
.right);
213 EXPECT_FLOAT_EQ(3.0f, rect
.top);
219 EXPECT_FLOAT_EQ(-1.0f, rect
.left);
220 EXPECT_FLOAT_EQ(-3.0f, rect
.bottom);
221 EXPECT_FLOAT_EQ(4.5f, rect
.right);
222 EXPECT_FLOAT_EQ(3.2f, rect
.top);
224 EXPECT_FLOAT_EQ(-0.5, rect
.left);
225 EXPECT_FLOAT_EQ(-1.5, rect
.bottom);
226 EXPECT_FLOAT_EQ(2.25f, rect
.right);
227 EXPECT_FLOAT_EQ(1.6f, rect
.top);
229 EXPECT_FLOAT_EQ(-1.0f, rect
.left);
230 EXPECT_FLOAT_EQ(-3.0f, rect
.bottom);
231 EXPECT_FLOAT_EQ(4.5f, rect
.right);
232 EXPECT_FLOAT_EQ(3.2f, rect
.top);
234 EXPECT_FLOAT_EQ(1.0f, rect
.left);
235 EXPECT_FLOAT_EQ(3.0f, rect
.bottom);
236 EXPECT_FLOAT_EQ(-4.5f, rect
.right);
237 EXPECT_FLOAT_EQ(-3.2f, rect
.top);
239 EXPECT_FLOAT_EQ(0.0f, rect
.left);
240 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
241 EXPECT_FLOAT_EQ(0.0f, rect
.right);
242 EXPECT_FLOAT_EQ(0.0f, rect
.top);
248 EXPECT_FLOAT_EQ(0.0f, rect
.left);
249 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
250 EXPECT_FLOAT_EQ(0.0f, rect
.right);
251 EXPECT_FLOAT_EQ(0.0f, rect
.top);
253 EXPECT_FLOAT_EQ(0.0f, rect
.left);
254 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
255 EXPECT_FLOAT_EQ(0.0f, rect
.right);
256 EXPECT_FLOAT_EQ(0.0f, rect
.top);
258 EXPECT_FLOAT_EQ(0.0f, rect
.left);
259 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
260 EXPECT_FLOAT_EQ(0.0f, rect
.right);
261 EXPECT_FLOAT_EQ(0.0f, rect
.top);
263 EXPECT_FLOAT_EQ(0.0f, rect
.left);
264 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
265 EXPECT_FLOAT_EQ(0.0f, rect
.right);
266 EXPECT_FLOAT_EQ(0.0f, rect
.top);
272 EXPECT_FLOAT_EQ(-1.0f, rect
.left);
273 EXPECT_FLOAT_EQ(-3.0f, rect
.bottom);
274 EXPECT_FLOAT_EQ(4.5f, rect
.right);
275 EXPECT_FLOAT_EQ(3.2f, rect
.top);
277 EXPECT_FLOAT_EQ(0.375f, rect
.left);
278 EXPECT_FLOAT_EQ(-1.45f, rect
.bottom);
279 EXPECT_FLOAT_EQ(3.125f, rect
.right);
280 EXPECT_FLOAT_EQ(1.65f, rect
.top);
282 EXPECT_FLOAT_EQ(-1.0f, rect
.left);
283 EXPECT_FLOAT_EQ(-3.0f, rect
.bottom);
284 EXPECT_FLOAT_EQ(4.5f, rect
.right);
285 EXPECT_FLOAT_EQ(3.2f, rect
.top);
287 EXPECT_FLOAT_EQ(4.5f, rect
.left);
288 EXPECT_FLOAT_EQ(3.2f, rect
.bottom);
289 EXPECT_FLOAT_EQ(-1.0f, rect
.right);
290 EXPECT_FLOAT_EQ(-3.0f, rect
.top);
292 EXPECT_FLOAT_EQ(1.75f, rect
.left);
293 EXPECT_NEAR(0.1f, rect
.bottom, 0.001f);
294 EXPECT_FLOAT_EQ(1.75f, rect
.right);
295 EXPECT_NEAR(0.1f, rect
.top, 0.001f);
301 EXPECT_FLOAT_EQ(0.0f, rect
.left);
302 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
303 EXPECT_FLOAT_EQ(0.0f, rect
.right);
304 EXPECT_FLOAT_EQ(0.0f, rect
.top);
306 EXPECT_FLOAT_EQ(0.0f, rect
.left);
307 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
308 EXPECT_FLOAT_EQ(0.0f, rect
.right);
309 EXPECT_FLOAT_EQ(0.0f, rect
.top);
311 EXPECT_FLOAT_EQ(0.0f, rect
.left);
312 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
313 EXPECT_FLOAT_EQ(0.0f, rect
.right);
314 EXPECT_FLOAT_EQ(0.0f, rect
.top);
316 EXPECT_FLOAT_EQ(0.0f, rect
.left);
317 EXPECT_FLOAT_EQ(0.0f, rect
.bottom);
318 EXPECT_FLOAT_EQ(0.0f, rect
.right);
319 EXPECT_FLOAT_EQ(0.0f, rect
.top);
398 static constexpr float data[6] = {3, 0, 2, 3, 1, 4};
402 EXPECT_FLOAT_EQ(0.33333334f, rev
.a);
403 EXPECT_FLOAT_EQ(0.0f, rev
.b);
404 EXPECT_FLOAT_EQ(-0.22222222f, rev
.c);
405 EXPECT_FLOAT_EQ(0.33333334f, rev
.d);
406 EXPECT_FLOAT_EQ(0.55555556f, rev
.e);
407 EXPECT_FLOAT_EQ(-1.3333334f, rev
.f);
409 CFX_PointF expected(2, 3);
410 CFX_PointF result = rev.Transform(m.Transform(CFX_PointF(2, 3)));
411 EXPECT_FLOAT_EQ(expected.x, result.x);
412 EXPECT_FLOAT_EQ(expected.y, result.y);
418 static constexpr float data[6] = {0.947368443f, -0.108947366f, -0.923076928f,
419 0.106153846f, 18.0f, 787.929993f};
423 EXPECT_FLOAT_EQ(14247728.0f, rev
.a);
424 EXPECT_FLOAT_EQ(14622668.0f, rev
.b);
425 EXPECT_FLOAT_EQ(1.2389329e+08f, rev
.c);
426 EXPECT_FLOAT_EQ(1.2715364e+08f, rev
.d);
427 EXPECT_FLOAT_EQ(-9.7875698e+10f, rev
.e);
428 EXPECT_FLOAT_EQ(-1.0045138e+11f, rev
.f);
431 CFX_PointF expected(0, 0);
432 CFX_PointF result = rev.Transform(m.Transform(CFX_PointF(2, 3)));
433 EXPECT_FLOAT_EQ(expected.x, result.x);
434 EXPECT_FLOAT_EQ(expected.y, result.y);
439 static constexpr float data[6] = {0.000037f, 0.0f, 0.0f,
440 -0.000037f, 182.413101f, 136.977646f};
444 EXPECT_FLOAT_EQ(27027.025f, rev
.a);
445 EXPECT_FLOAT_EQ(0.0f, rev
.b);
446 EXPECT_FLOAT_EQ(0.0f, rev
.c);
447 EXPECT_FLOAT_EQ(-27027.025f, rev
.d);
448 EXPECT_FLOAT_EQ(-4930083.5f, rev
.e);
449 EXPECT_FLOAT_EQ(3702098.2f, rev
.f);
452 CFX_PointF expected(2, 2.75);
453 CFX_PointF result = rev.Transform(m.Transform(CFX_PointF(2, 3)));
454 EXPECT_FLOAT_EQ(expected.x, result.x);
455 EXPECT_FLOAT_EQ(expected.y, result.y);
470 EXPECT_FLOAT_EQ(0.0f, rotate_90
.e);
471 EXPECT_FLOAT_EQ(0.0f, rotate_90
.f);
475 EXPECT_FLOAT_EQ(1.0f, translate_23_11
.a);
476 EXPECT_FLOAT_EQ(0.0f, translate_23_11
.b);
477 EXPECT_FLOAT_EQ(0.0f, translate_23_11
.c);
478 EXPECT_FLOAT_EQ(1.0f, translate_23_11
.d);
479 EXPECT_FLOAT_EQ(23.0f, translate_23_11
.e);
480 EXPECT_FLOAT_EQ(11.0f, translate_23_11
.f);
484 EXPECT_FLOAT_EQ(5.0f, scale_5_13
.a);
485 EXPECT_FLOAT_EQ(0.0f, scale_5_13
.b);
486 EXPECT_FLOAT_EQ(0.0f, scale_5_13
.c);
487 EXPECT_FLOAT_EQ(13.0f, scale_5_13
.d);
488 EXPECT_FLOAT_EQ(0.0, scale_5_13
.e);
489 EXPECT_FLOAT_EQ(0.0, scale_5_13
.f);
492 CFX_PointF origin_transformed(0, 0);
493 CFX_PointF p_10_20_transformed(10, 20);
495 origin_transformed = rotate_90
.Transform(origin_transformed
);
496 EXPECT_FLOAT_EQ(0.0f, origin_transformed.x);
497 EXPECT_FLOAT_EQ(0.0f, origin_transformed.y);
498 p_10_20_transformed = rotate_90
.Transform(p_10_20_transformed
);
499 EXPECT_FLOAT_EQ(-20.0f, p_10_20_transformed.x);
500 EXPECT_FLOAT_EQ(10.0f, p_10_20_transformed.y);
502 origin_transformed = translate_23_11
.Transform(origin_transformed
);
503 EXPECT_FLOAT_EQ(23.0f, origin_transformed.x);
504 EXPECT_FLOAT_EQ(11.0f, origin_transformed.y);
505 p_10_20_transformed = translate_23_11
.Transform(p_10_20_transformed
);
506 EXPECT_FLOAT_EQ(3.0f, p_10_20_transformed.x);
507 EXPECT_FLOAT_EQ(21.0f, p_10_20_transformed.y);
509 origin_transformed = scale_5_13
.Transform(origin_transformed
);
510 EXPECT_FLOAT_EQ(115.0f, origin_transformed.x);
511 EXPECT_FLOAT_EQ(143.0f, origin_transformed.y);
512 p_10_20_transformed = scale_5_13
.Transform(p_10_20_transformed
);
513 EXPECT_FLOAT_EQ(15.0f, p_10_20_transformed.x);
514 EXPECT_FLOAT_EQ(273.0f, p_10_20_transformed.y);
517 origin_transformed = CFX_PointF(0, 0);
518 p_10_20_transformed = CFX_PointF(10, 20);
520 origin_transformed = scale_5_13
.Transform(origin_transformed
);
521 EXPECT_FLOAT_EQ(0.0f, origin_transformed.x);
522 EXPECT_FLOAT_EQ(0.0f, origin_transformed.y);
523 p_10_20_transformed = scale_5_13
.Transform(p_10_20_transformed
);
524 EXPECT_FLOAT_EQ(50.0f, p_10_20_transformed.x);
525 EXPECT_FLOAT_EQ(260.0f, p_10_20_transformed.y);
527 origin_transformed = translate_23_11
.Transform(origin_transformed
);
528 EXPECT_FLOAT_EQ(23.0f, origin_transformed.x);
529 EXPECT_FLOAT_EQ(11.0f, origin_transformed.y);
530 p_10_20_transformed = translate_23_11
.Transform(p_10_20_transformed
);
531 EXPECT_FLOAT_EQ(73.0f, p_10_20_transformed.x);
532 EXPECT_FLOAT_EQ(271.0f, p_10_20_transformed.y);
534 origin_transformed = rotate_90
.Transform(origin_transformed
);
535 EXPECT_FLOAT_EQ(-11.0f, origin_transformed.x);
536 EXPECT_FLOAT_EQ(23.0f, origin_transformed.y);
537 p_10_20_transformed = rotate_90
.Transform(p_10_20_transformed
);
538 EXPECT_FLOAT_EQ(-271.0f, p_10_20_transformed.x);
539 EXPECT_FLOAT_EQ(73.0f, p_10_20_transformed.y);
550 EXPECT_FLOAT_EQ(115.0, m
.e);
551 EXPECT_FLOAT_EQ(143.0, m
.f);
555 origin_transformed = m
.Transform(CFX_PointF(0, 0));
556 EXPECT_FLOAT_EQ(115.0f, origin_transformed.x);
557 EXPECT_FLOAT_EQ(143.0f, origin_transformed.y);
559 p_10_20_transformed = m
.Transform(CFX_PointF(10, 20));
560 EXPECT_FLOAT_EQ(15.0f, p_10_20_transformed.x);
561 EXPECT_FLOAT_EQ(273.0f, p_10_20_transformed.y);
566 m
= translate_23_11
* m;
572 EXPECT_FLOAT_EQ(-11.0, m
.e);
573 EXPECT_FLOAT_EQ(23.0, m
.f);
578 origin_transformed = m
.Transform(CFX_PointF(0, 0));
579 EXPECT_FLOAT_EQ(-11.0f, origin_transformed.x);
580 EXPECT_FLOAT_EQ(23.0f, origin_transformed.y);
582 p_10_20_transformed = m
.Transform(CFX_PointF(10, 20));
583 EXPECT_FLOAT_EQ(-271.0f, p_10_20_transformed.x);
584 EXPECT_FLOAT_EQ(73.0f, p_10_20_transformed.y);