Closed Bug 1278236 Opened 9 years ago Closed 9 years ago

Convert GetSurfaceForGdkDrawable to return a DrawTarget

Categories

(Core :: Widget: Gtk, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(2 files, 1 obsolete file)

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.
Attached patch patch (obsolete) — Splinter Review
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.
Attached patch patchSplinter Review
Attachment #8760256 - Attachment is obsolete: true
Attachment #8760347 - Flags: review?(bas)
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 jwatt@jwatt.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/f26550274a45 Convert GetSurfaceForGdkDrawable to return a DrawTarget. r=Bas
Status: NEW → RESOLVED
Closed: 9 years ago
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?
Flags: needinfo?(c)
I can compile it with the patch.
Flags: needinfo?(c)
Depends on: 1281074
(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;
Depends on: 1280964
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: