Closed Bug 1015211 Opened 10 years ago Closed 10 years ago

Implement StartRemoteDrawing for GTK3

Categories

(Core :: Graphics: Layers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1013552

People

(Reporter: fred23, Assigned: fred23)

References

Details

Attachments

(1 file, 1 obsolete file)

We need GTK3 support in StartRemoteDrawing() since I'm making BasicCompositor kick in there days for GTK3 on OMTC linux.

The patch is simple, it basically gets a soft ref (not with cairo_reference, of course) on the current cairo_t when it's passed to OnExposeEvent(...) and use that when StartRemoteDrawing() is called to retrieve the ThebesSurface.
Attachment #8427786 - Flags: review?(chrislord.net)
Blocks: 1015218
Depends on: 1015262
No longer blocks: 1015218
Sorry, the previous patch was not the most up-to-date one on my system. Here's the one that works ;-)
Attachment #8427786 - Attachment is obsolete: true
Attachment #8427786 - Flags: review?(chrislord.net)
Attachment #8428745 - Flags: review?(chrislord.net)
Comment on attachment 8428745 [details] [diff] [review]
GTK3_StartRemoteDrawing.patch

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

I think there are better people to review this, but the change is small and I think it looks fine with the second comment addressed (rename mCr to mCairoCtx, or something similar).

::: widget/gtk/nsWindow.h
@@ +332,5 @@
>      bool                mEnabled;
>      // has the native window for this been created yet?
>      bool                mCreated;
> +    // with GTK3 builds, we need to keep track of the associated cairo_t
> +    // for stuff like ::StartRemoteDrawing()

The cairo_t associated with the window I presume?

@@ +333,5 @@
>      // has the native window for this been created yet?
>      bool                mCreated;
> +    // with GTK3 builds, we need to keep track of the associated cairo_t
> +    // for stuff like ::StartRemoteDrawing()
> +    cairo_t*            mCr;

mCr isn't a good name for this, mCairoCtx would make the code a lot more readable.
Attachment #8428745 - Flags: review?(chrislord.net) → review+
Comment on attachment 8428745 [details] [diff] [review]
GTK3_StartRemoteDrawing.patch

I'm going to mark this r- sorry, because the cairo_t is only valid for the life of the expose event.  The pointer should at least be nulled before the expose event handler returns, but I think we'll need something after that point anyway, so I prefer the approach in bug 1013552.

Can you include function names and more context in future patches please?
Mercurial can be configured to do this automatically as described at
https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F
Attachment #8428745 - Flags: review-
(In reply to Karl Tomlinson (needinfo?:karlt) from comment #3)
> Comment on attachment 8428745 [details] [diff] [review]
> GTK3_StartRemoteDrawing.patch
> 
> I'm going to mark this r- sorry, because the cairo_t is only valid for the
> life of the expose event.  The pointer should at least be nulled before the
> expose event handler returns, but I think we'll need something after that
> point anyway, so I prefer the approach in bug 1013552.

ah, cool !  Didn't know someone already got a nice fix for that, thanks !
I'll pull the change from 1013552, which seems to be doing the trick
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
No longer depends on: 1015262
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: