Closed Bug 981794 Opened 6 years ago Closed 6 years ago

Tiles are incorrectly clipped on b2g in landscape mode

Categories

(Core :: Graphics: Layers, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: nical, Assigned: nical)

References

Details

Attachments

(1 file)

The clip rect is on the coordinate space of the final frame buffer which doesn't take screen orientation into account, while layer's coordinate space is dependent on screen orientation.
I am not 100% sure this is correct from a mathematical point of view but it seems to work on b2g.
Attachment #8388713 - Flags: review?(bas)
Blocks: b2g-tiling
Comment on attachment 8388713 [details] [diff] [review]
take screen rotation into account when comparing tile rects with the clip rect

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

Iewl.
Attachment #8388713 - Flags: review?(bas) → review+
I rebased and pushed to try again and the oranges in both pushes are different and look unrelated to the patch: https://tbpl.mozilla.org/?tree=Try&rev=9af4842858d8
https://hg.mozilla.org/mozilla-central/rev/499a25915134
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Depends on: 993004
Comment on attachment 8388713 [details] [diff] [review]
take screen rotation into account when comparing tile rects with the clip rect

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

More discussion in bug 993004.

::: gfx/layers/Compositor.h
@@ +498,5 @@
> +  gfx::Rect ClipRectInLayersCoordinates(gfx::Rect aClip) const {
> +    switch (mScreenRotation) {
> +      case ROTATION_90:
> +      case ROTATION_270:
> +        return gfx::Rect(aClip.y, aClip.x, aClip.height, aClip.width);

I have a feeling this isn't quite right, and that either 90 or 270 case should be (aClip.y, aClip.width-aClip.x, aClip.height, aClip.width)
(In reply to Milan Sreckovic [:milan] from comment #7)
> 
> ::: gfx/layers/Compositor.h
> @@ +498,5 @@
> > +  gfx::Rect ClipRectInLayersCoordinates(gfx::Rect aClip) const {
> > +    switch (mScreenRotation) {
> > +      case ROTATION_90:
> > +      case ROTATION_270:
> > +        return gfx::Rect(aClip.y, aClip.x, aClip.height, aClip.width);
> 
> I have a feeling this isn't quite right, and that either 90 or 270 case
> should be (aClip.y, aClip.width-aClip.x, aClip.height, aClip.width)

Actually, not that simple; probably

(screenWidth - y - height, x, height, width)

and

(y, screenHeight - x - width, height, width)

modulo the definition of "screenWidth" and "screenHeight".
You need to log in before you can comment on or make changes to this bug.