Nicholas Nethercote
3f2b2ab546
Bug 1223690 - Remove implicit Rect conversions. r=jrmuizel.
...
gfxRect can be implicitly constructed from IntRect, which hides a number of
implicit conversion points, makes Moz2Dification harder, and has some
surprising effects.
This patch removes the implicit constructor and replaces it with an explicit
conversion function:
gfxRect ThebesRect(const IntRect&)
This is the obvious outcome of removing the constructor.
But there is also a second, less obvious outcome: currently we do a number of
IntRect-to-Rect conversions using ToRect(), which (surprisingly) works because
it turns into an implicit IntRect-to-gfxRect conversion (via the implicit
constructor) combined with an explicit gfxRect-to-Rect conversion (via
ToRect()). I.e. we do two conversions, going from a Moz2D type to a Thebes
type and back to a Moz2D type!
So this patch also changes these conversion. It moves this existing function:
Rect ToRect(const IntRect&)
from gfx2DGlue.h -- where it doesn't really belong because it doesn't involve
any Thebes types -- to gfx/2d/Rect.h, templatifying and renaming it as
IntRectToRect() in the process.
The rest of the patch deals with fall-out from these changes. The call sites
change as follows:
- IntRect-to-gfxRect conversions:
- old: implicit
- new: ThebesRect()
- IntRect-to-Rect conversions:
- old: ToRect()
- new: IntRectToRect()
2015-11-11 14:23:14 -08:00
..
2015-11-09 21:37:32 -08:00
2015-11-09 18:22:25 -05:00
2015-03-10 05:54:59 -05:00
2015-11-11 14:23:14 -08:00
2015-11-11 13:50:04 +13:00
2015-08-25 09:14:38 -07:00
2015-11-09 21:37:32 -08:00
2014-02-06 12:32:05 -07:00
2015-11-10 11:49:05 +09:00
2015-11-09 21:37:32 -08:00
2015-11-09 18:22:25 -05:00
2015-08-25 09:14:38 -07:00
2015-09-22 21:39:03 -07:00
2015-10-28 12:53:34 -04:00
2014-03-14 22:13:30 +09:00
2015-10-18 01:24:48 -04:00
2015-09-11 21:21:26 +09:00
2015-08-26 21:56:59 +09:00
2015-07-13 08:25:42 -07:00
2015-07-13 08:25:42 -07:00
2014-11-03 15:05:12 +08:00
2015-09-17 12:05:44 +09:00
2015-10-23 21:37:28 -07:00
2015-07-13 08:25:42 -07:00
2015-09-28 01:44:00 +02:00
2015-09-28 01:44:00 +02:00
2015-10-17 22:57:38 -07:00
2015-07-28 15:45:34 -07:00
2015-01-24 16:38:08 +01:00
2015-07-13 08:25:42 -07:00
2014-11-10 15:16:50 -08:00
2015-07-13 08:25:42 -07:00
2015-08-04 16:17:36 -07:00
2015-07-09 11:48:06 +01:00
2015-10-26 20:46:27 -07:00
2015-11-09 21:37:31 -08:00
2015-10-28 12:53:34 -04:00
2015-09-25 00:59:00 +02:00
2015-09-11 01:59:53 +09:00
2015-10-16 13:19:27 +09:00
2015-08-27 20:44:53 -07:00
2015-02-04 11:01:19 +09:00
2015-10-16 11:04:11 -07:00
2015-04-23 15:10:30 -04:00
2015-08-11 06:10:46 -07:00
2015-08-11 06:10:46 -07:00
2014-10-23 10:16:45 -07:00
2014-10-23 10:16:45 -07:00
2015-11-09 21:37:32 -08:00
2015-11-09 18:22:25 -05:00
2015-10-18 01:24:48 -04:00
2015-05-18 14:52:26 +01:00
2015-02-06 15:04:32 -08:00
2015-03-21 12:28:04 -04:00
2015-11-09 21:37:32 -08:00
2015-11-09 21:37:32 -08:00
2015-05-21 21:50:09 +01:00
2014-10-23 10:16:45 -07:00
2015-10-27 14:41:58 -07:00
2015-03-21 12:28:04 -04:00
2015-08-04 16:17:36 -07:00
2015-03-27 18:52:19 +00:00
2015-04-15 21:17:00 +02:00
2015-11-02 07:53:26 +02:00
2015-10-21 22:16:40 +13:00
2015-10-18 01:24:48 -04:00
2015-10-18 01:24:48 -04:00
2015-11-09 21:37:31 -08:00
2014-10-23 10:16:45 -07:00
2014-10-23 10:16:45 -07:00
2015-06-08 04:41:00 -04:00
2015-08-11 06:10:46 -07:00
2015-04-16 16:14:35 -04:00
2014-02-28 16:07:30 +01:00
2015-05-21 21:50:09 +01:00
2013-07-08 09:11:43 -04:00
2014-01-04 10:02:17 -05:00
2015-06-05 11:29:30 +08:00
2015-10-18 01:24:48 -04:00
2015-10-18 01:24:48 -04:00
2015-09-28 20:29:48 -04:00
2015-04-08 21:48:11 +03:00
2015-05-18 14:52:26 +01:00
2015-07-24 12:45:55 -07:00
2014-01-08 18:43:03 +01:00
2014-04-17 16:54:50 -04:00
2014-03-28 08:45:02 +00:00
2015-04-21 17:04:57 +02:00
2015-03-09 10:52:18 -07:00
2015-06-11 09:34:27 +12:00
2015-04-21 17:04:57 +02:00
2014-07-14 13:22:26 -04:00
2014-07-14 13:22:26 -04:00
2014-07-18 21:06:02 +02:00
2014-09-21 09:41:56 -07:00
2015-11-06 22:13:40 -05:00
2015-08-25 08:51:58 +03:00
2015-11-04 11:49:49 -05:00
2015-06-16 19:51:29 +01:00
2015-11-09 21:37:32 -08:00
2015-03-16 14:30:41 -04:00
2015-10-30 14:35:28 -04:00
2015-10-20 12:06:27 +03:00
2015-10-18 01:24:48 -04:00
2014-10-28 11:59:08 -04:00
2014-10-23 10:16:45 -07:00
2015-09-07 17:53:36 -04:00
2015-10-18 01:24:48 -04:00
2015-09-07 17:53:36 -04:00
2015-11-02 07:53:26 +02:00
2015-10-18 01:24:48 -04:00
2015-10-22 23:01:31 -07:00
2015-10-18 01:24:48 -04:00
2015-10-30 14:35:28 -04:00
2015-02-18 06:52:00 -05:00
2015-05-12 01:26:01 -04:00
2015-06-16 19:51:29 +01:00
2015-09-25 00:59:00 +02:00
2015-09-25 00:59:00 +02:00
2015-07-15 12:44:01 -04:00
2015-07-15 12:44:01 -04:00
2015-04-10 15:18:05 -07:00
2015-04-10 15:18:05 -07:00
2015-11-06 22:13:40 -05:00
2015-11-09 18:22:25 -05:00
2015-11-02 07:53:26 +02:00
2015-10-18 01:24:48 -04:00
2015-02-19 15:50:19 +09:00
2015-10-26 09:29:54 +09:00
2015-10-18 01:24:48 -04:00
2015-10-18 01:24:48 -04:00
2015-01-28 15:27:32 +09:00
2015-10-18 01:24:48 -04:00
2015-06-18 13:43:18 +09:00
2015-10-28 12:53:34 -04:00
2015-04-20 17:28:25 -07:00
2015-10-18 01:24:48 -04:00
2015-09-17 12:05:44 +09:00
2015-04-23 17:18:52 +02:00
2015-07-13 08:25:42 -07:00
2015-10-19 13:22:55 +02:00
2015-05-08 03:29:00 +02:00