mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 593604. Part 8: Add SetAllowUseAsSource API for better diagnostics. r=jrmuizel,a=blocking
This commit is contained in:
parent
03b628b846
commit
ac7bd36fb0
@ -220,8 +220,17 @@ public:
|
||||
|
||||
virtual PRBool SupportsSelfCopy() { return PR_TRUE; }
|
||||
|
||||
/**
|
||||
* Mark the surface as being allowed/not allowed to be used as a source.
|
||||
* This currently has no effect other than triggering assertions in some
|
||||
* cases.
|
||||
*/
|
||||
void SetAllowUseAsSource(PRBool aAllow) { mAllowUseAsSource = aAllow; }
|
||||
PRBool GetAllowUseAsSource() { return mAllowUseAsSource; }
|
||||
|
||||
protected:
|
||||
gfxASurface() : mSurface(nsnull), mFloatingRefs(0), mBytesRecorded(0), mSurfaceValid(PR_FALSE)
|
||||
gfxASurface() : mSurface(nsnull), mFloatingRefs(0), mBytesRecorded(0),
|
||||
mSurfaceValid(PR_FALSE), mAllowUseAsSource(PR_TRUE)
|
||||
{
|
||||
MOZ_COUNT_CTOR(gfxASurface);
|
||||
}
|
||||
@ -249,6 +258,7 @@ private:
|
||||
|
||||
protected:
|
||||
PRPackedBool mSurfaceValid;
|
||||
PRPackedBool mAllowUseAsSource;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -692,6 +692,7 @@ gfxContext::GetDeviceColor(gfxRGBA& c)
|
||||
void
|
||||
gfxContext::SetSource(gfxASurface *surface, const gfxPoint& offset)
|
||||
{
|
||||
NS_ASSERTION(surface->GetAllowUseAsSource(), "Surface not allowed to be used as source!");
|
||||
cairo_set_source_surface(mCairo, surface->CairoSurface(), offset.x, offset.y);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user