Bug 1369840 - Support getting the compositor-side APZ test data over PWebRenderBridge. r=botond

This is fairly straightforward plumbing. The webrender equivalent of PLayerTransaction
is PWebRenderBridge and we can use that to get the compositor-side APZTestData.

MozReview-Commit-ID: JE9WkmejuM9

--HG--
extra : rebase_source : 8872e8dffb988740fa816870cfad25dd6a7d3c21
This commit is contained in:
Kartikaya Gupta 2017-06-02 16:19:33 -04:00
Родитель 11cd4ff18c
Коммит 044a03ec40
4 изменённых файлов: 19 добавлений и 2 удалений

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

@ -3908,13 +3908,20 @@ nsDOMWindowUtils::GetCompositorAPZTestData(JSContext* aContext,
if (!lm) {
return NS_OK;
}
APZTestData compositorSideData;
if (ClientLayerManager* clm = lm->AsClientLayerManager()) {
APZTestData compositorSideData;
clm->GetCompositorSideAPZTestData(&compositorSideData);
if (!compositorSideData.ToJS(aOutCompositorTestData, aContext)) {
} else if (WebRenderLayerManager* wrlm = lm->AsWebRenderLayerManager()) {
if (!wrlm->WrBridge()) {
return NS_ERROR_UNEXPECTED;
}
if (!wrlm->WrBridge()->SendGetAPZTestData(&compositorSideData)) {
return NS_ERROR_FAILURE;
}
}
if (!compositorSideData.ToJS(aOutCompositorTestData, aContext)) {
return NS_ERROR_FAILURE;
}
}
return NS_OK;

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

@ -14,6 +14,7 @@ include WebRenderMessages;
include protocol PCompositorBridge;
include protocol PTexture;
using mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h";
@ -76,6 +77,7 @@ parent:
sync SetAsyncScrollOffset(ViewID scrollId, float x, float y);
sync SetAsyncZoom(ViewID scrollId, float zoom);
async FlushApzRepaints();
sync GetAPZTestData() returns (APZTestData data);
async Shutdown();
child:

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

@ -768,6 +768,13 @@ WebRenderBridgeParent::RecvFlushApzRepaints()
return IPC_OK();
}
mozilla::ipc::IPCResult
WebRenderBridgeParent::RecvGetAPZTestData(APZTestData* aOutData)
{
mCompositorBridge->GetAPZTestData(GetLayersId(), aOutData);
return IPC_OK();
}
void
WebRenderBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
{

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

@ -126,6 +126,7 @@ public:
mozilla::ipc::IPCResult RecvSetAsyncZoom(const FrameMetrics::ViewID& aScrollId,
const float& aZoom) override;
mozilla::ipc::IPCResult RecvFlushApzRepaints() override;
mozilla::ipc::IPCResult RecvGetAPZTestData(APZTestData* data) override;
void ActorDestroy(ActorDestroyReason aWhy) override;
void SetWebRenderProfilerEnabled(bool aEnabled);