As part of getting rid of gfxXlibSurface (and ultimately gfxASurface) I have a patch that pushes the DrawTarget wrapping of the gfxXlibSurface created by GetSurfaceForGdkDrawable back to just after it is created (rather than passing it out to callers and having it wrapped later). Once we get to a point where all gfxXlibSurface surfaces are immediately wrapped it becomes easy to replace them all with a DrawTarget that directly wraps a cairo_xlib_surface_t.
Created attachment 8760256 [details] [diff] [review] patch
Attachment #8760256 - Flags: review?(bas)
Comment on attachment 8760256 [details] [diff] [review] patch Review of attachment 8760256 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/gtk/nsWindow.cpp @@ +6462,5 @@ > return keyBindings->Execute(aEvent, aCallback, aCallbackData); > } > > #if defined(MOZ_X11) && (MOZ_WIDGET_GTK == 2) > /* static */ already_AddRefed<gfxASurface> I don't see how this compiles since the return value here is wrong.
Attachment #8760256 - Flags: review?(bas) → review-
Good catch. I guess that must mean all our linux builders on Try are using gtk3 now.
Created attachment 8760347 [details] [diff] [review] patch
FWIW I need this patch to make progress on tier 1 work, but karlt considers this code tier 2 - we don't bother to build and test it ourselves, but we should try to write code that will work for it: https://bugzilla.mozilla.org/show_bug.cgi?id=1278282#c1
Attachment #8760347 - Flags: review?(bas) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/f26550274a45 Convert GetSurfaceForGdkDrawable to return a DrawTarget. r=Bas
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox50: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
/media/data/develop/mozilla/central/widget/gtk/nsDragService.cpp:446:48: error: no matching constructor for initialization of 'IntRect'
Does the patch is comment 9 fix things?
I can compile it with the patch.
(In reply to Jonathan Watt [:jwatt] from comment #9) > Created attachment 8762689 [details] [diff] [review] > potential compilation fix This patch does not fix the compilation issue for me. I additionally need this as well: diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -316,17 +316,17 @@ public: nsresult UpdateTranslucentWindowAlphaInternal(const nsIntRect& aRect, uint8_t* aAlphas, int32_t aStride); already_AddRefed<mozilla::gfx::DrawTarget> GetDrawTarget(const LayoutDeviceIntRegion& aRegion, mozilla::layers::BufferMode* aBufferMode); #if (MOZ_WIDGET_GTK == 2) static already_AddRefed<DrawTarget> GetDrawTargetForGdkDrawable(GdkDrawable* aDrawable, - const IntSize& aSize); + const nsIntSize& aSize); #endif NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) override; virtual nsresult SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, uint32_t aModifierFlags, nsIObserver* aObserver) override;
You need to log in before you can comment on or make changes to this bug.