mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 966679 - Resolve RefLayers during IPDL transactions. r=nical
This commit is contained in:
parent
c6e16097b9
commit
a008f620fb
@ -98,6 +98,9 @@ WalkTheTree(Layer* aLayer,
|
||||
void
|
||||
AsyncCompositionManager::ResolveRefLayers()
|
||||
{
|
||||
if (!mLayerManager->GetRoot()) {
|
||||
return;
|
||||
}
|
||||
WalkTheTree<Resolve>(mLayerManager->GetRoot(),
|
||||
mReadyForCompose,
|
||||
mTargetConfig);
|
||||
@ -106,6 +109,9 @@ AsyncCompositionManager::ResolveRefLayers()
|
||||
void
|
||||
AsyncCompositionManager::DetachRefLayers()
|
||||
{
|
||||
if (!mLayerManager->GetRoot()) {
|
||||
return;
|
||||
}
|
||||
WalkTheTree<Detach>(mLayerManager->GetRoot(),
|
||||
mReadyForCompose,
|
||||
mTargetConfig);
|
||||
|
@ -201,10 +201,18 @@ private:
|
||||
class MOZ_STACK_CLASS AutoResolveRefLayers {
|
||||
public:
|
||||
AutoResolveRefLayers(AsyncCompositionManager* aManager) : mManager(aManager)
|
||||
{ mManager->ResolveRefLayers(); }
|
||||
{
|
||||
if (mManager) {
|
||||
mManager->ResolveRefLayers();
|
||||
}
|
||||
}
|
||||
|
||||
~AutoResolveRefLayers()
|
||||
{ mManager->DetachRefLayers(); }
|
||||
{
|
||||
if (mManager) {
|
||||
mManager->DetachRefLayers();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncCompositionManager* mManager;
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite) MOZ_OVERRIDE;
|
||||
virtual AsyncCompositionManager* GetCompositionManager() MOZ_OVERRIDE { return mCompositionManager; }
|
||||
/**
|
||||
* This forces the is-first-paint flag to true. This is intended to
|
||||
* be called by the widget code when it loses its viewport information
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
|
||||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/layers/TextureHost.h"
|
||||
#include "mozilla/layers/AsyncCompositionManager.h"
|
||||
|
||||
typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
|
||||
|
||||
@ -205,7 +206,10 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
|
||||
EditReplyVector replyv;
|
||||
|
||||
layer_manager()->BeginTransactionWithDrawTarget(nullptr);
|
||||
{
|
||||
AutoResolveRefLayers resolve(mShadowLayersManager->GetCompositionManager());
|
||||
layer_manager()->BeginTransaction();
|
||||
}
|
||||
|
||||
for (EditArray::index_type i = 0; i < cset.Length(); ++i) {
|
||||
const Edit& edit = cset[i];
|
||||
@ -439,7 +443,10 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
}
|
||||
}
|
||||
|
||||
layer_manager()->EndTransaction(nullptr, nullptr, LayerManager::END_NO_IMMEDIATE_REDRAW);
|
||||
{
|
||||
AutoResolveRefLayers resolve(mShadowLayersManager->GetCompositionManager());
|
||||
layer_manager()->EndTransaction(nullptr, nullptr, LayerManager::END_NO_IMMEDIATE_REDRAW);
|
||||
}
|
||||
|
||||
if (reply) {
|
||||
reply->SetCapacity(replyv.size());
|
||||
|
@ -12,6 +12,7 @@ namespace layers {
|
||||
|
||||
class TargetConfig;
|
||||
class LayerTransactionParent;
|
||||
class AsyncCompositionManager;
|
||||
|
||||
class ShadowLayersManager
|
||||
{
|
||||
@ -20,6 +21,8 @@ public:
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite) = 0;
|
||||
|
||||
virtual AsyncCompositionManager* GetCompositionManager() { return nullptr; }
|
||||
};
|
||||
|
||||
} // layers
|
||||
|
Loading…
Reference in New Issue
Block a user