mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1164763 - Avoid one extra IPC round-trip when compositor-lru-size == 0. r=mattwoodrow,billm
This commit is contained in:
parent
59770e5830
commit
9797e46901
@ -143,6 +143,19 @@ private:
|
|||||||
TabChild *mTabChild;
|
TabChild *mTabChild;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static bool
|
||||||
|
UsingCompositorLRU()
|
||||||
|
{
|
||||||
|
static bool sHavePrefs = false;
|
||||||
|
static uint32_t sCompositorLRUSize = 0;
|
||||||
|
if (!sHavePrefs) {
|
||||||
|
sHavePrefs = true;
|
||||||
|
Preferences::AddUintVarCache(&sCompositorLRUSize,
|
||||||
|
"layers.compositor-lru-size", 0);
|
||||||
|
}
|
||||||
|
return sCompositorLRUSize != 0;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(TabChild::DelayedFireContextMenuEvent,
|
NS_IMPL_ISUPPORTS(TabChild::DelayedFireContextMenuEvent,
|
||||||
nsITimerCallback)
|
nsITimerCallback)
|
||||||
|
|
||||||
@ -2987,7 +3000,9 @@ void
|
|||||||
TabChild::MakeVisible()
|
TabChild::MakeVisible()
|
||||||
{
|
{
|
||||||
CompositorChild* compositor = CompositorChild::Get();
|
CompositorChild* compositor = CompositorChild::Get();
|
||||||
|
if (UsingCompositorLRU()) {
|
||||||
compositor->SendNotifyVisible(mLayersId);
|
compositor->SendNotifyVisible(mLayersId);
|
||||||
|
}
|
||||||
|
|
||||||
if (mWidget) {
|
if (mWidget) {
|
||||||
mWidget->Show(true);
|
mWidget->Show(true);
|
||||||
@ -2998,7 +3013,14 @@ void
|
|||||||
TabChild::MakeHidden()
|
TabChild::MakeHidden()
|
||||||
{
|
{
|
||||||
CompositorChild* compositor = CompositorChild::Get();
|
CompositorChild* compositor = CompositorChild::Get();
|
||||||
|
if (UsingCompositorLRU()) {
|
||||||
compositor->SendNotifyHidden(mLayersId);
|
compositor->SendNotifyHidden(mLayersId);
|
||||||
|
} else {
|
||||||
|
// Clear cached resources directly. This avoids one extra IPC
|
||||||
|
// round-trip from CompositorChild to CompositorParent when
|
||||||
|
// CompositorLRU is not used.
|
||||||
|
compositor->RecvClearCachedResources(mLayersId);
|
||||||
|
}
|
||||||
|
|
||||||
if (mWidget) {
|
if (mWidget) {
|
||||||
mWidget->Show(false);
|
mWidget->Show(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user