mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 938528 - Check if data in the layer is still valid. r=gw280, r=snorp
This commit is contained in:
parent
e53321c213
commit
19a48551b0
@ -3999,7 +3999,10 @@ CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderingContext2DUserData* userData =
|
||||
static_cast<CanvasRenderingContext2DUserData*>(
|
||||
aOldLayer->GetUserData(&g2DContextLayerUserData));
|
||||
if (userData && userData->IsForContext(this)) {
|
||||
|
||||
CanvasLayer::Data data;
|
||||
data.mGLContext = static_cast<GLContext*>(mTarget->GetGLContext());
|
||||
if (userData && userData->IsForContext(this) && aOldLayer->IsDataValid(data)) {
|
||||
nsRefPtr<CanvasLayer> ret = aOldLayer;
|
||||
return ret.forget();
|
||||
}
|
||||
|
@ -69,6 +69,12 @@ CopyableCanvasLayer::Initialize(const Data& aData)
|
||||
mBounds.SetRect(0, 0, aData.mSize.width, aData.mSize.height);
|
||||
}
|
||||
|
||||
bool
|
||||
CopyableCanvasLayer::IsDataValid(const Data& aData)
|
||||
{
|
||||
return mGLContext == aData.mGLContext;
|
||||
}
|
||||
|
||||
void
|
||||
CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
|
||||
{
|
||||
|
@ -40,7 +40,8 @@ public:
|
||||
virtual ~CopyableCanvasLayer();
|
||||
|
||||
virtual void Initialize(const Data& aData);
|
||||
|
||||
|
||||
virtual bool IsDataValid(const Data& aData);
|
||||
|
||||
protected:
|
||||
void PaintWithOpacity(gfxContext* aContext,
|
||||
|
@ -1733,6 +1733,11 @@ public:
|
||||
*/
|
||||
virtual void Initialize(const Data& aData) = 0;
|
||||
|
||||
/**
|
||||
* Check the data is owned by this layer is still valid for rendering
|
||||
*/
|
||||
virtual bool IsDataValid(const Data& aData) { return true; }
|
||||
|
||||
/**
|
||||
* Notify this CanvasLayer that the canvas surface contents have
|
||||
* changed (or will change) before the next transaction.
|
||||
|
Loading…
Reference in New Issue
Block a user