Bug 1492930 - Part 5. Integrate extra shared surface memory reporting with gfx. r=nical

This patch enables the compositor process memory reporting for both the
dedicated GPU process case, and the integrated with the main process
case. This will simply cause us to list all of the entries in the shared
surfaces cache to show what is presently mapped in.
This commit is contained in:
Andrew Osmond 2018-09-25 06:18:06 -04:00
Родитель 5d483b60ce
Коммит 1a68680204
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -22,6 +22,7 @@
#include "mozilla/dom/VideoDecoderManagerParent.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/image/ImageMemoryReporter.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/layers/APZInputBridgeParent.h"
@ -268,6 +269,7 @@ GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
// Make sure to do this *after* we update gfxVars above.
if (gfxVars::UseWebRender()) {
wr::RenderThread::Start();
image::ImageMemoryReporter::InitForWebRender();
}
VRManager::ManagerInit();
@ -538,6 +540,8 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
wr::RenderThread::ShutDown();
}
image::ImageMemoryReporter::ShutdownForWebRender();
// Shut down the default GL context provider.
gl::GLContextProvider::Shutdown();

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/FontPropertyTypes.h"
#include "mozilla/image/ImageMemoryReporter.h"
#include "mozilla/layers/CompositorManagerChild.h"
#include "mozilla/layers/CompositorThread.h"
#include "mozilla/layers/ImageBridgeChild.h"
@ -1144,6 +1145,7 @@ gfxPlatform::InitLayersIPC()
if (XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying()) {
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS) && gfxVars::UseWebRender()) {
wr::RenderThread::Start();
image::ImageMemoryReporter::InitForWebRender();
}
layers::CompositorThreadHolder::Start();
@ -1177,6 +1179,7 @@ gfxPlatform::ShutdownLayersIPC()
// This has to happen after shutting down the child protocols.
layers::CompositorThreadHolder::Shutdown();
gfx::VRListenerThreadHolder::Shutdown();
image::ImageMemoryReporter::ShutdownForWebRender();
// There is a case that RenderThread exists when gfxVars::UseWebRender() is false.
// This could happen when WebRender was fallbacked to compositor.
if (wr::RenderThread::Get()) {