Comment 74 for bug 531719

Revision history for this message
In , Karlt (karlt) wrote :

Comment on attachment 481492
minimal branch patch

Requesting approval for 1.9.1, mostly for SeaMonkey on distributions that build with system cairo.

It's a small patch, but changes semantics a little.

With XPCOM's ref-counting system, objects typically need to be AddRefed and Released to be deleted. Without this patch nsWindow would do this and so the object would get deleted even if the caller did not. With this patch callers must AddRef and Release.

The change actually makes the behavior consistent with cocoa and winnt's GetThebesSurface().

I checked that existing callers (in 1.9.1 mozilla-central) AddRef and Release.

nsBaseWidget::GetRenderingContext()
  > nsThebesRenderingContext::Init(nsIDeviceContext*, gfxASurface*)
    > gfxContext

nsThebesDeviceContext::CreateRenderingContext()

nsThebesRenderingContext::Init(nsIDeviceContext*, nsIWidget*)
  > gfxContext