mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 622072. Part 2: Add DidTransactionCallback to CanvasLayer. r=bas, sr=joe
This commit is contained in:
parent
6536947736
commit
333b8d0f05
@ -1181,6 +1181,16 @@ public:
|
||||
*/
|
||||
void Updated() { mDirty = PR_TRUE; }
|
||||
|
||||
/**
|
||||
* Register a callback to be called at the end of each transaction.
|
||||
*/
|
||||
typedef void (* DidTransactionCallback)(void* aClosureData);
|
||||
void SetDidTransactionCallback(DidTransactionCallback aCallback, void* aClosureData)
|
||||
{
|
||||
mCallback = aCallback;
|
||||
mCallbackData = aClosureData;
|
||||
}
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Set the filter used to resample this image (if necessary).
|
||||
@ -1204,14 +1214,25 @@ public:
|
||||
|
||||
protected:
|
||||
CanvasLayer(LayerManager* aManager, void* aImplData)
|
||||
: Layer(aManager, aImplData), mFilter(gfxPattern::FILTER_GOOD), mDirty(PR_FALSE) {}
|
||||
: Layer(aManager, aImplData),
|
||||
mCallback(nsnull), mCallbackData(nsnull), mFilter(gfxPattern::FILTER_GOOD),
|
||||
mDirty(PR_FALSE) {}
|
||||
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
|
||||
void FireDidTransactionCallback()
|
||||
{
|
||||
if (mCallback) {
|
||||
mCallback(mCallbackData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 0, 0, canvaswidth, canvasheight
|
||||
*/
|
||||
nsIntRect mBounds;
|
||||
DidTransactionCallback mCallback;
|
||||
void* mCallbackData;
|
||||
gfxPattern::GraphicsFilter mFilter;
|
||||
/**
|
||||
* Set to true in Updated(), cleared during a transaction.
|
||||
|
@ -995,6 +995,7 @@ void
|
||||
BasicCanvasLayer::Paint(gfxContext* aContext)
|
||||
{
|
||||
UpdateSurface();
|
||||
FireDidTransactionCallback();
|
||||
PaintWithOpacity(aContext, GetEffectiveOpacity());
|
||||
}
|
||||
|
||||
|
@ -228,10 +228,10 @@ void
|
||||
CanvasLayerD3D10::RenderLayer()
|
||||
{
|
||||
UpdateSurface();
|
||||
FireDidTransactionCallback();
|
||||
|
||||
if (!mTexture) {
|
||||
if (!mTexture)
|
||||
return;
|
||||
}
|
||||
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
|
||||
|
@ -209,6 +209,8 @@ void
|
||||
CanvasLayerD3D9::RenderLayer()
|
||||
{
|
||||
UpdateSurface();
|
||||
FireDidTransactionCallback();
|
||||
|
||||
if (!mTexture)
|
||||
return;
|
||||
|
||||
|
@ -184,6 +184,7 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
|
||||
const nsIntPoint& aOffset)
|
||||
{
|
||||
UpdateSurface();
|
||||
FireDidTransactionCallback();
|
||||
|
||||
mOGLManager->MakeCurrent();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user