Closed Bug 1480608 Opened 6 years ago Closed 6 years ago

[blob image] Skip over items that aren't in bounds

Categories

(Core :: Graphics: WebRender, enhancement, P3)

63 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

Attachments

(1 file)

We already have the bounds at hand. It's easy for us to skip over the parts of the blob image that aren't used.
Blocks: 1480196
Priority: -- → P3
Comment on attachment 8997585 [details]
Bug 1480608. Skip over items that aren't in DrawTarget/DirtyRect.

https://reviewboard.mozilla.org/r/261274/#review268384

::: gfx/webrender_bindings/Moz2DImageRenderer.cpp:290
(Diff revision 1)
>      int ReadInt() {
>        int ret;

Unrelated to this patch, but should these ints be int32_ts as well?

::: gfx/webrender_bindings/Moz2DImageRenderer.cpp:320
(Diff revision 1)
> -    reader.SkipBounds();
> +    auto combinedBounds = absBounds.Intersect(reader.ReadBounds());
> +    if (combinedBounds.IsEmpty()) {

You're not using the value of combinedBounds, so this could be written as a boolean Intersects check instead.

auto itemBounds = reader.ReadBounds();
if (!absBounds.Intersects(itemBounds)) {
  ...
}
Attachment #8997585 - Flags: review?(mstange) → review+
Comment on attachment 8997585 [details]
Bug 1480608. Skip over items that aren't in DrawTarget/DirtyRect.

https://reviewboard.mozilla.org/r/261274/#review268804

::: gfx/webrender_bindings/Moz2DImageRenderer.cpp:320
(Diff revision 1)
> -    reader.SkipBounds();
> +    auto combinedBounds = absBounds.Intersect(reader.ReadBounds());
> +    if (combinedBounds.IsEmpty()) {

There's no implementation of Intersects() and it's unclear what the semantics of it should be.
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/00ff83d23238
Skip over items that aren't in DrawTarget/DirtyRect. r=mstange
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6c2a436870e0
Skip over items that aren't in DrawTarget/DirtyRect. r=mstange
https://hg.mozilla.org/mozilla-central/rev/6c2a436870e0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Flags: needinfo?(jmuizelaar)
Assignee: nobody → jmuizelaar
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: