зеркало из https://github.com/mozilla/gecko-dev.git
Bug 626962. Implement empty transactions for GL. r=bas,a=blocking
This commit is contained in:
Родитель
46d71e308e
Коммит
50259b5af5
|
@ -301,10 +301,8 @@ public:
|
||||||
* returns false, and the caller must proceed with a normal layer tree
|
* returns false, and the caller must proceed with a normal layer tree
|
||||||
* update and EndTransaction.
|
* update and EndTransaction.
|
||||||
*/
|
*/
|
||||||
virtual bool EndEmptyTransaction()
|
virtual bool EndEmptyTransaction() = 0;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Function called to draw the contents of each ThebesLayer.
|
* Function called to draw the contents of each ThebesLayer.
|
||||||
* aRegionToDraw contains the region that needs to be drawn.
|
* aRegionToDraw contains the region that needs to be drawn.
|
||||||
|
|
|
@ -392,6 +392,16 @@ LayerManagerOGL::BeginTransactionWithTarget(gfxContext *aTarget)
|
||||||
mTarget = aTarget;
|
mTarget = aTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LayerManagerOGL::EndEmptyTransaction()
|
||||||
|
{
|
||||||
|
if (!mRoot)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
EndTransaction(nsnull, nsnull);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
|
LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData)
|
void* aCallbackData)
|
||||||
|
@ -413,10 +423,7 @@ LayerManagerOGL::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||||
mThebesLayerCallback = aCallback;
|
mThebesLayerCallback = aCallback;
|
||||||
mThebesLayerCallbackData = aCallbackData;
|
mThebesLayerCallbackData = aCallbackData;
|
||||||
|
|
||||||
// NULL callback means "non-painting transaction"
|
Render();
|
||||||
if (aCallback) {
|
|
||||||
Render();
|
|
||||||
}
|
|
||||||
|
|
||||||
mThebesLayerCallback = nsnull;
|
mThebesLayerCallback = nsnull;
|
||||||
mThebesLayerCallbackData = nsnull;
|
mThebesLayerCallbackData = nsnull;
|
||||||
|
|
|
@ -136,6 +136,7 @@ public:
|
||||||
|
|
||||||
void EndConstruction();
|
void EndConstruction();
|
||||||
|
|
||||||
|
virtual bool EndEmptyTransaction();
|
||||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||||
void* aCallbackData);
|
void* aCallbackData);
|
||||||
|
|
||||||
|
|
|
@ -693,14 +693,18 @@ ThebesLayerOGL::RenderLayer(int aPreviousFrameBuffer,
|
||||||
|
|
||||||
LayerManager::DrawThebesLayerCallback callback =
|
LayerManager::DrawThebesLayerCallback callback =
|
||||||
mOGLManager->GetThebesLayerCallback();
|
mOGLManager->GetThebesLayerCallback();
|
||||||
void* callbackData = mOGLManager->GetThebesLayerCallbackData();
|
if (!callback) {
|
||||||
callback(this, state.mContext, state.mRegionToDraw,
|
NS_ERROR("GL should never need to update ThebesLayers in an empty transaction");
|
||||||
state.mRegionToInvalidate, callbackData);
|
} else {
|
||||||
// Everything that's visible has been validated. Do this instead of
|
void* callbackData = mOGLManager->GetThebesLayerCallbackData();
|
||||||
// OR-ing with aRegionToDraw, since that can lead to a very complex region
|
callback(this, state.mContext, state.mRegionToDraw,
|
||||||
// here (OR doesn't automatically simplify to the simplest possible
|
state.mRegionToInvalidate, callbackData);
|
||||||
// representation of a region.)
|
// Everything that's visible has been validated. Do this instead of
|
||||||
mValidRegion.Or(mValidRegion, mVisibleRegion);
|
// OR-ing with aRegionToDraw, since that can lead to a very complex region
|
||||||
|
// here (OR doesn't automatically simplify to the simplest possible
|
||||||
|
// representation of a region.)
|
||||||
|
mValidRegion.Or(mValidRegion, mVisibleRegion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_GL_ERROR_CHECK(gl());
|
DEBUG_GL_ERROR_CHECK(gl());
|
||||||
|
|
Загрузка…
Ссылка в новой задаче