Closed Bug 802143 Opened 12 years ago Closed 12 years ago

ReusableTileStoreOGL miscalculates the content bounds

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: cwiiis, Assigned: cwiiis)

References

Details

Attachments

(1 file)

At some point, FrameMetrics was changed to pre-multiplied values of the render resolution and this broke the content bounds calculations in ReusableTileStoreOGL.

This means that tiles that shouldn't be retained end up retained, and vice-versa. Patch incoming.
I think this fixes the problems, but I'm not entirely certain - if you could help test this, that'd be great.
Attachment #672268 - Flags: review?(bgirard)
Comment on attachment 672268 [details] [diff] [review]
Fix display-port and content bounds calculation in ReusableTileStoreOGL::DrawTiles

Review of attachment 672268 [details] [diff] [review]:
-----------------------------------------------------------------

I think it's worth clarify in what space each variables are before landing.

::: gfx/layers/opengl/ReusableTileStoreOGL.cpp
@@ +217,5 @@
>        const FrameMetrics& parentMetrics = parent->GetFrameMetrics();
>        if (parentMetrics.IsScrollable())
>          scrollableLayer = parent;
>        if (!parentMetrics.mDisplayPort.IsEmpty() && scrollableLayer) {
> +          // Get the display-port bounds

I always have trouble wrapping my head around this kind of code because I don't know in what units each of the measurements are.

// Get the display-port bounds in screen space.

@@ +224,5 @@
> +                                parentMetrics.mDisplayPort.width,
> +                                parentMetrics.mDisplayPort.height);
> +
> +          // Check the scale transform applied to the root layer to determine
> +          // the content resolution.

I'd expect to see a if() when I see 'Check'. Maybe Compute/Calculate.

@@ +230,5 @@
> +          const gfx3DMatrix& rootTransform = rootLayer->GetTransform();
> +          float scaleX = rootTransform.GetXScale();
> +          float scaleY = rootTransform.GetYScale();
> +
> +          // Get the content document bounds

in screen or layer space?
Attachment #672268 - Flags: review?(bgirard) → review+
I'll be testing the patch today. Up to you if you want to wait for my results or land this.
I had the patch in my queue today and it seemed fine. I still saw a few tiny glitches but I have no reason to believe it's coming from this patch.
Pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/05863d81fa3b - forgot to clarify comments, will push a follow-up.
https://hg.mozilla.org/mozilla-central/rev/05863d81fa3b
https://hg.mozilla.org/mozilla-central/rev/c2e53249351d
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: