mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 703472. Retain the DataSourceSurface. r=bas
The Quartz Azure backend has the data owned by the DataSourceSurface so we can't drop the DataSourceSurface after creating an image surface around it. This patch keeps the DataSourceSurface around for the lifetime of the gfxASurface. --HG-- extra : rebase_source : d758646bab85d827c09af390d11e5e30ad33a6c9
This commit is contained in:
parent
2bcb0f0c44
commit
3dc2412d44
@ -515,6 +515,13 @@ gfxPlatform::GetScaledFontForFont(gfxFont *aFont)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cairo_user_data_key_t kDrawSourceSurface;
|
||||||
|
static void
|
||||||
|
DataSourceSurfaceDestroy(void *dataSourceSurface)
|
||||||
|
{
|
||||||
|
static_cast<DataSourceSurface*>(dataSourceSurface)->Release();
|
||||||
|
}
|
||||||
|
|
||||||
already_AddRefed<gfxASurface>
|
already_AddRefed<gfxASurface>
|
||||||
gfxPlatform::GetThebesSurfaceForDrawTarget(DrawTarget *aTarget)
|
gfxPlatform::GetThebesSurfaceForDrawTarget(DrawTarget *aTarget)
|
||||||
{
|
{
|
||||||
@ -531,6 +538,8 @@ gfxPlatform::GetThebesSurfaceForDrawTarget(DrawTarget *aTarget)
|
|||||||
nsRefPtr<gfxImageSurface> image =
|
nsRefPtr<gfxImageSurface> image =
|
||||||
new gfxImageSurface(data->GetData(), gfxIntSize(size.width, size.height),
|
new gfxImageSurface(data->GetData(), gfxIntSize(size.width, size.height),
|
||||||
data->Stride(), format);
|
data->Stride(), format);
|
||||||
|
|
||||||
|
image->SetData(&kDrawSourceSurface, data.forget().drop(), DataSourceSurfaceDestroy);
|
||||||
return image.forget();
|
return image.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user