Bug 1758983 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Well. This indeed happens with the testcase from bug 1758985. Fixing a similar issue there just results in an overflow further down the line in `Rect::RoundOut()`:

```
145         return IntRectTyped(int32_t(tmp.X()), int32_t(tmp.Y()),
(rr) p tmp
$1 = {<mozilla::gfx::BaseRect<float, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float>, mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float>, mozilla::gfx::SizeTyped<mozilla::gfx::UnknownUnits, float>, mozilla::gfx::MarginTyped<mozilla::gfx::UnknownUnits, float> >> = {x = 0, y = 2.68213376e+09, width = <synthetic pointer>,
    height = <synthetic pointer>}, <mozilla::gfx::UnknownUnits> = {<No data fields>}, <No data fields>}
(rr) bt
#0  mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits>::RoundOut(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&) (aRect=...)
    at /home/miko/Code/mu/obj-ff-dbg-opt/dist/include/mozilla/gfx/Rect.h:145
#1  0x00007fb17cb33fc7 in mozilla::gfx::RoundedOut<mozilla::gfx::UnknownUnits>(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&) (aRect=...)
    at /home/miko/Code/mu/obj-ff-dbg-opt/dist/include/mozilla/gfx/Rect.h:329
#2  mozilla::layers::DIGroup::ToDeviceSpace(nsRect, mozilla::gfx::BaseMatrix<float>&, int) (aBounds=..., aMatrix=..., aAppUnitsPerDevPixel=<optimized out>, aAppUnitsPerDevPixel@entry=40)
    at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:377
#3  0x00007fb17cb2e459 in mozilla::layers::DIGroup::ComputeGeometryChange(mozilla::nsDisplayItem*, mozilla::layers::BlobItemData*, mozilla::gfx::BaseMatrix<float>&, mozilla::nsDisplayListBuilder*)
    (this=this@entry=0x7fb162ae5a40, aItem=aItem@entry=0x7fb162af1270, aData=aData@entry=0x7fb162ae0b00, aMatrix=..., aBuilder=<optimized out>) at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:417
#4  0x00007fb17cb089c2 in mozilla::layers::Grouper::ConstructItemInsideInactive(mozilla::layers::WebRenderCommandBuilder*, mozilla::wr::DisplayListBuilder&, mozilla::wr::IpcResourceUpdateQueue&, mozilla::layers::DIGroup*, mozilla::nsDisplayItem*, mozilla::layers::StackingContextHelper const&) (this=this@entry=0x7ffe02a9a2e8, aCommandBuilder=aCommandBuilder@entry=0x7fb1888c9ff0,
    aBuilder=..., aResources=..., aGroup=aGroup@entry=0x7fb162ae5a40, aItem=aItem@entry=0x7fb162af1270, aSc=...) at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:1341
#5  0x00007fb17cb08627 in mozilla::layers::Grouper::ConstructGroups(mozilla::nsDisplayListBuilder*, mozilla::layers::WebRenderCommandBuilder*, mozilla::wr::DisplayListBuilder&, mozilla::wr::IpcResourceUpdateQueue&, mozilla::layers::DIGroup*, mozilla::nsDisplayList*, mozilla::nsDisplayItem*, mozilla::layers::StackingContextHelper const&) (this=<optimized out>,
    this@entry=0x7ffe02a9a2e8, aDisplayListBuilder=aDisplayListBuilder@entry=0x7fb162aeb000, aCommandBuilder=aCommandBuilder@entry=0x7fb1888c9ff0, aBuilder=<optimized out>, aResources=<optimized out>, aGroup=aGroup@entry=0x7fb162ae5a40, aList=0x7fb162af3d30, aWrappingItem=0x7fb162af3c90, aSc=...) at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:1302
#6  0x00007fb17cb091f0 in mozilla::layers::WebRenderCommandBuilder::DoGroupingForDisplayList(mozilla::nsDisplayList*, mozilla::nsDisplayItem*, mozilla::nsDisplayListBuilder*, mozilla::layers::StackingContextHelper const&, mozilla::wr::DisplayListBuilder&, mozilla::wr::IpcResourceUpdateQueue&) (this=<optimized out>,
```
Well. This indeed happens with the testcase from bug 1758985. Fixing a similar issue there just results in an overflow further down the line in `IntRectTyped::RoundOut()`:

```
145         return IntRectTyped(int32_t(tmp.X()), int32_t(tmp.Y()),
(rr) p tmp
$1 = {<mozilla::gfx::BaseRect<float, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float>, mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float>, mozilla::gfx::SizeTyped<mozilla::gfx::UnknownUnits, float>, mozilla::gfx::MarginTyped<mozilla::gfx::UnknownUnits, float> >> = {x = 0, y = 2.68213376e+09, width = <synthetic pointer>,
    height = <synthetic pointer>}, <mozilla::gfx::UnknownUnits> = {<No data fields>}, <No data fields>}
(rr) bt
#0  mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits>::RoundOut(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&) (aRect=...)
    at /home/miko/Code/mu/obj-ff-dbg-opt/dist/include/mozilla/gfx/Rect.h:145
#1  0x00007fb17cb33fc7 in mozilla::gfx::RoundedOut<mozilla::gfx::UnknownUnits>(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&) (aRect=...)
    at /home/miko/Code/mu/obj-ff-dbg-opt/dist/include/mozilla/gfx/Rect.h:329
#2  mozilla::layers::DIGroup::ToDeviceSpace(nsRect, mozilla::gfx::BaseMatrix<float>&, int) (aBounds=..., aMatrix=..., aAppUnitsPerDevPixel=<optimized out>, aAppUnitsPerDevPixel@entry=40)
    at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:377
#3  0x00007fb17cb2e459 in mozilla::layers::DIGroup::ComputeGeometryChange(mozilla::nsDisplayItem*, mozilla::layers::BlobItemData*, mozilla::gfx::BaseMatrix<float>&, mozilla::nsDisplayListBuilder*)
    (this=this@entry=0x7fb162ae5a40, aItem=aItem@entry=0x7fb162af1270, aData=aData@entry=0x7fb162ae0b00, aMatrix=..., aBuilder=<optimized out>) at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:417
#4  0x00007fb17cb089c2 in mozilla::layers::Grouper::ConstructItemInsideInactive(mozilla::layers::WebRenderCommandBuilder*, mozilla::wr::DisplayListBuilder&, mozilla::wr::IpcResourceUpdateQueue&, mozilla::layers::DIGroup*, mozilla::nsDisplayItem*, mozilla::layers::StackingContextHelper const&) (this=this@entry=0x7ffe02a9a2e8, aCommandBuilder=aCommandBuilder@entry=0x7fb1888c9ff0,
    aBuilder=..., aResources=..., aGroup=aGroup@entry=0x7fb162ae5a40, aItem=aItem@entry=0x7fb162af1270, aSc=...) at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:1341
#5  0x00007fb17cb08627 in mozilla::layers::Grouper::ConstructGroups(mozilla::nsDisplayListBuilder*, mozilla::layers::WebRenderCommandBuilder*, mozilla::wr::DisplayListBuilder&, mozilla::wr::IpcResourceUpdateQueue&, mozilla::layers::DIGroup*, mozilla::nsDisplayList*, mozilla::nsDisplayItem*, mozilla::layers::StackingContextHelper const&) (this=<optimized out>,
    this@entry=0x7ffe02a9a2e8, aDisplayListBuilder=aDisplayListBuilder@entry=0x7fb162aeb000, aCommandBuilder=aCommandBuilder@entry=0x7fb1888c9ff0, aBuilder=<optimized out>, aResources=<optimized out>, aGroup=aGroup@entry=0x7fb162ae5a40, aList=0x7fb162af3d30, aWrappingItem=0x7fb162af3c90, aSc=...) at /home/miko/Code/mu/gfx/layers/wr/WebRenderCommandBuilder.cpp:1302
#6  0x00007fb17cb091f0 in mozilla::layers::WebRenderCommandBuilder::DoGroupingForDisplayList(mozilla::nsDisplayList*, mozilla::nsDisplayItem*, mozilla::nsDisplayListBuilder*, mozilla::layers::StackingContextHelper const&, mozilla::wr::DisplayListBuilder&, mozilla::wr::IpcResourceUpdateQueue&) (this=<optimized out>,
```

Back to Bug 1758983 Comment 5