(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #20) > (In reply to Sameem [:sameembaba] from comment #19) > > I tested both paths: > > > > • `drawWindow()` fails in the Canvas 2D layer with `InvalidStateError: Canvas exceeds max size`, due to the `gfx.canvas.max-area` limit. > > • `drawSnapshot()` fails deeper in the snapshot/compositor pipeline with `NS_ERROR_LOSS_OF_SIGNIFICANT_DATA`. > > Hi Lee, given that you wrote the patch on bug 1911583 maybe you can help us? Maybe it was not intended to use larger canvas sizes for screenshots, especially when both the width and height larger than 32767? Or it is a miss and we should add proper support for it? Thanks! To be compatible with our Skia backends, the total size (also considering BPP) still needs to fit in a signed 32-bit integer to not overflow. For compat, we needed to be able to support sizes such as 64000x10, which is a very small area objectively, but has a dimension over the previous 32K limit. We, however, would not support a 64000x64000 canvas, because that would violate the constraint that pixel addresses can fit in signed 32 bits.
Bug 1994148 Comment 21 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #20) > (In reply to Sameem [:sameembaba] from comment #19) > > I tested both paths: > > > > • `drawWindow()` fails in the Canvas 2D layer with `InvalidStateError: Canvas exceeds max size`, due to the `gfx.canvas.max-area` limit. > > • `drawSnapshot()` fails deeper in the snapshot/compositor pipeline with `NS_ERROR_LOSS_OF_SIGNIFICANT_DATA`. > > Hi Lee, given that you wrote the patch on bug 1911583 maybe you can help us? Maybe it was not intended to use larger canvas sizes for screenshots, especially when both the width and height larger than 32767? Or it is a miss and we should add proper support for it? Thanks! To be compatible with our Skia backends, the total size still needs to fit in a signed 32-bit integer to not overflow. For compat, we needed to be able to support sizes such as 64000x10, which is a very small area objectively, but has a dimension over the previous 32K limit. We, however, would not support a 64000x64000 canvas, because that would violate the constraint that the size can fit in signed 32 bits without overflow.
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #20) > (In reply to Sameem [:sameembaba] from comment #19) > > I tested both paths: > > > > • `drawWindow()` fails in the Canvas 2D layer with `InvalidStateError: Canvas exceeds max size`, due to the `gfx.canvas.max-area` limit. > > • `drawSnapshot()` fails deeper in the snapshot/compositor pipeline with `NS_ERROR_LOSS_OF_SIGNIFICANT_DATA`. > > Hi Lee, given that you wrote the patch on bug 1911583 maybe you can help us? Maybe it was not intended to use larger canvas sizes for screenshots, especially when both the width and height larger than 32767? Or it is a miss and we should add proper support for it? Thanks! To be compatible with our Skia backends, the total size still needs to fit in a signed 32-bit integer to not overflow. For compat, we needed to be able to support sizes such as 64000x10, which is a very small area objectively, but has a dimension over the previous 32K limit. We, however, would not support a 64000x64000 canvas, because that would violate the constraint that the size can fit in signed 32 bits without overflow. Essentially, I kept the area constraint to the same effective value as would be imposed by a 32K x 32K limit, but I allow individual dimensions to reach up to 64K.
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #20) > (In reply to Sameem [:sameembaba] from comment #19) > > I tested both paths: > > > > • `drawWindow()` fails in the Canvas 2D layer with `InvalidStateError: Canvas exceeds max size`, due to the `gfx.canvas.max-area` limit. > > • `drawSnapshot()` fails deeper in the snapshot/compositor pipeline with `NS_ERROR_LOSS_OF_SIGNIFICANT_DATA`. > > Hi Lee, given that you wrote the patch on bug 1911583 maybe you can help us? Maybe it was not intended to use larger canvas sizes for screenshots, especially when both the width and height larger than 32767? Or it is a miss and we should add proper support for it? Thanks! To be compatible with our Skia backends, the total size still needs to fit in a signed 32-bit integer to not overflow. For compat, we needed to be able to support sizes such as 64000x10, which is a very small area objectively, but has a dimension over the previous 32K limit. We, however, would not support a 64000x64000 canvas, because that would violate the constraint that the size can fit in signed 32 bits without overflow. Essentially, I kept the area constraint to the same effective value as would be imposed by a 32K x 32K limit, but I allow individual dimensions to reach up to 64K. The gfx.canvas.max-area pref implements this constraint.
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #20) > (In reply to Sameem [:sameembaba] from comment #19) > > I tested both paths: > > > > • `drawWindow()` fails in the Canvas 2D layer with `InvalidStateError: Canvas exceeds max size`, due to the `gfx.canvas.max-area` limit. > > • `drawSnapshot()` fails deeper in the snapshot/compositor pipeline with `NS_ERROR_LOSS_OF_SIGNIFICANT_DATA`. > > Hi Lee, given that you wrote the patch on bug 1911583 maybe you can help us? Maybe it was not intended to use larger canvas sizes for screenshots, especially when both the width and height larger than 32767? Or it is a miss and we should add proper support for it? Thanks! To be compatible with our Skia backends, the total size still needs to fit in a signed 32-bit integer to not overflow. For compat, we needed to be able to support sizes such as 64000x10, which is a very small area objectively, but has a dimension over the previous 32K limit. We, however, would not support a 64000x64000 canvas, because that would violate the constraint that the size can fit in signed 32 bits without overflow. Essentially, I kept the area constraint to the same effective value as would be imposed by a 32K x 32K limit (as I am not sure yet we want to allow canvases that can consume more memory internally without any headroom), but I allow individual dimensions to reach up to 64K. The gfx.canvas.max-area pref implements this constraint.