Closed Bug 1396489 Opened 2 years ago Closed 2 years ago

Let gfxContext::GetClipExtents be able to return clipped rect in either user space or device space

Categories

(Core :: Web Painting, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: u459114, Assigned: u459114)

Details

Attachments

(3 files)

Currently,  gfxContext::GetClipExtents can only return a clipped rect in user space. If what you need is that rect in device space, you have to change the transform matrix of the target context to identify matrix to prevent device-space-to-user-space conversion in gfxContext::GetClipExtents. If we pass a argument to gfxContext::GetClipExtents, tell it whether apply device-space-to-user-space conversion, the code at the caller side can be simpler.
Attachment #8904136 - Flags: review?(mstange)
Attachment #8904137 - Flags: review?(mstange)
Attachment #8904138 - Flags: review?(mstange)
Comment on attachment 8904136 [details]
Bug 1396489  - Part 1. Change gfxContext::GetClipExtents to a const function.

https://reviewboard.mozilla.org/r/175916/#review180910
Attachment #8904136 - Flags: review?(mstange) → review+
Comment on attachment 8904137 [details]
Bug 1396489  - Part 2. Make gfxContext::GetClipExtents can return clipped rect in either user space or device space.

https://reviewboard.mozilla.org/r/175918/#review180918

::: gfx/thebes/gfxContext.h:385
(Diff revision 1)
>      /**
>       * This will return the current bounds of the clip region in user
> -     * space.
> +     * space, if aInUserSpace is true, or in device space, if aInUserSpace is
> +     * false.
>       */
> -    gfxRect GetClipExtents() const;
> +    gfxRect GetClipExtents(bool aInUserSpace = true) const;

Please create an enum for this. For example ClipExtentsSpace::eUserSpace / eDeviceSpace
Comment on attachment 8904137 [details]
Bug 1396489  - Part 2. Make gfxContext::GetClipExtents can return clipped rect in either user space or device space.

https://reviewboard.mozilla.org/r/175918/#review181096
Attachment #8904137 - Flags: review?(mstange) → review+
Comment on attachment 8904138 [details]
Bug 1396489 - Part 3. Use gfxContext::GetClipExtents(false) when clipped rect in device space is needed.

https://reviewboard.mozilla.org/r/175920/#review181104
Attachment #8904138 - Flags: review?(mstange) → review+
Pushed by cku@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dcfd73044bba
Part 1. Change gfxContext::GetClipExtents to a const function. r=mstange
https://hg.mozilla.org/integration/autoland/rev/fc779b639aeb
Part 2. Make gfxContext::GetClipExtents can return clipped rect in either user space or device space. r=mstange
https://hg.mozilla.org/integration/autoland/rev/75ffa3ed13d5
Part 3. Use gfxContext::GetClipExtents(false) when clipped rect in device space is needed. r=mstange
Pushed by cku@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/979541296fc3
Part 1. Change gfxContext::GetClipExtents to a const function. r=mstange
https://hg.mozilla.org/integration/autoland/rev/b495a85ddfaa
Part 2. Make gfxContext::GetClipExtents can return clipped rect in either user space or device space. r=mstange
https://hg.mozilla.org/integration/autoland/rev/cba1405295ad
Part 3. Use gfxContext::GetClipExtents(false) when clipped rect in device space is needed. r=mstange
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.