mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 764125; store a reference to the backing surface in DrawTargetCairo; r=Bas
This commit is contained in:
parent
a49759020b
commit
07975bdcdb
@ -245,6 +245,9 @@ DrawTargetCairo::~DrawTargetCairo()
|
||||
mPathObserver->ForgetDrawTarget();
|
||||
}
|
||||
cairo_destroy(mContext);
|
||||
if (mSurface) {
|
||||
cairo_surface_destroy(mSurface);
|
||||
}
|
||||
}
|
||||
|
||||
IntSize
|
||||
@ -723,6 +726,8 @@ bool
|
||||
DrawTargetCairo::Init(cairo_surface_t* aSurface, const IntSize& aSize)
|
||||
{
|
||||
mContext = cairo_create(aSurface);
|
||||
mSurface = aSurface;
|
||||
cairo_surface_reference(mSurface);
|
||||
mSize = aSize;
|
||||
|
||||
return true;
|
||||
|
@ -157,6 +157,7 @@ private: // methods
|
||||
|
||||
private: // data
|
||||
cairo_t* mContext;
|
||||
cairo_surface_t* mSurface;
|
||||
IntSize mSize;
|
||||
std::vector<SourceSurfaceCairo*> mSnapshots;
|
||||
mutable RefPtr<CairoPathContext> mPathObserver;
|
||||
|
@ -103,6 +103,7 @@ SourceSurfaceCairo::DrawTargetWillChange()
|
||||
cairo_set_source(ctx, pat);
|
||||
cairo_paint(ctx);
|
||||
cairo_destroy(ctx);
|
||||
cairo_pattern_destroy(pat);
|
||||
|
||||
// Swap in this new surface.
|
||||
cairo_surface_destroy(mSurface);
|
||||
|
Loading…
Reference in New Issue
Block a user