mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
Bug 770617 - Always mark inactive CanvasLayers as being dirty. r=cjones
This commit is contained in:
parent
930cae2bd2
commit
202bc0e49e
@ -1389,6 +1389,26 @@ public:
|
||||
*/
|
||||
void Updated() { mDirty = true; SetInvalidRectToVisibleRegion(); }
|
||||
|
||||
/**
|
||||
* Notify this CanvasLayer that the canvas surface contents have
|
||||
* been painted since the last change.
|
||||
*/
|
||||
void Painted() { mDirty = false; }
|
||||
|
||||
/**
|
||||
* Returns true if the canvas surface contents have changed since the
|
||||
* last paint.
|
||||
*/
|
||||
bool IsDirty()
|
||||
{
|
||||
// We can only tell if we are dirty if we're part of the
|
||||
// widget's retained layer tree.
|
||||
if (!mManager || !mManager->IsWidgetLayerManager()) {
|
||||
return true;
|
||||
}
|
||||
return mDirty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a callback to be called at the end of each transaction.
|
||||
*/
|
||||
@ -1443,6 +1463,8 @@ protected:
|
||||
DidTransactionCallback mCallback;
|
||||
void* mCallbackData;
|
||||
gfxPattern::GraphicsFilter mFilter;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Set to true in Updated(), cleared during a transaction.
|
||||
*/
|
||||
|
@ -120,9 +120,9 @@ BasicCanvasLayer::Initialize(const Data& aData)
|
||||
void
|
||||
BasicCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
|
||||
{
|
||||
if (!mDirty)
|
||||
if (!IsDirty())
|
||||
return;
|
||||
mDirty = false;
|
||||
Painted();
|
||||
|
||||
if (mDrawTarget) {
|
||||
mDrawTarget->Flush();
|
||||
@ -393,7 +393,7 @@ BasicShadowableCanvasLayer::Paint(gfxContext* aContext, Layer* aMaskLayer)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mDirty)
|
||||
if (!IsDirty())
|
||||
return;
|
||||
|
||||
if (mGLContext &&
|
||||
|
@ -103,9 +103,9 @@ CanvasLayerD3D10::Initialize(const Data& aData)
|
||||
void
|
||||
CanvasLayerD3D10::UpdateSurface()
|
||||
{
|
||||
if (!mDirty)
|
||||
if (!IsDirty())
|
||||
return;
|
||||
mDirty = false;
|
||||
Painted();
|
||||
|
||||
if (mDrawTarget) {
|
||||
mDrawTarget->Flush();
|
||||
|
@ -58,9 +58,9 @@ CanvasLayerD3D9::Initialize(const Data& aData)
|
||||
void
|
||||
CanvasLayerD3D9::UpdateSurface()
|
||||
{
|
||||
if (!mDirty && mTexture)
|
||||
if (!IsDirty() && mTexture)
|
||||
return;
|
||||
mDirty = false;
|
||||
Painted();
|
||||
|
||||
if (!mTexture) {
|
||||
CreateTexture();
|
||||
|
@ -172,9 +172,9 @@ MakeIOSurfaceTexture(void* aCGIOSurfaceContext, mozilla::gl::GLContext* aGL)
|
||||
void
|
||||
CanvasLayerOGL::UpdateSurface()
|
||||
{
|
||||
if (!mDirty)
|
||||
if (!IsDirty())
|
||||
return;
|
||||
mDirty = false;
|
||||
Painted();
|
||||
|
||||
if (mDestroyed || mDelayedUpdates) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user