зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1137875 - Have the SharedFrameMetricsData hold a copy of the layers id. r=nical
This commit is contained in:
Родитель
282fe7260a
Коммит
223d0204b5
|
@ -3098,7 +3098,7 @@ void AsyncPanZoomController::ShareCompositorFrameMetrics() {
|
|||
// Send the shared memory handle and cross process handle to the content
|
||||
// process by an asynchronous ipc call. Include the APZC unique ID
|
||||
// so the content process know which APZC sent this shared FrameMetrics.
|
||||
if (!compositor->SendSharedCompositorFrameMetrics(mem, handle, mAPZCId)) {
|
||||
if (!compositor->SendSharedCompositorFrameMetrics(mem, handle, mLayersId, mAPZCId)) {
|
||||
APZC_LOG("%p failed to share FrameMetrics with content process.", this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -339,9 +339,11 @@ bool
|
|||
CompositorChild::RecvSharedCompositorFrameMetrics(
|
||||
const mozilla::ipc::SharedMemoryBasic::Handle& metrics,
|
||||
const CrossProcessMutexHandle& handle,
|
||||
const uint64_t& aLayersId,
|
||||
const uint32_t& aAPZCId)
|
||||
{
|
||||
SharedFrameMetricsData* data = new SharedFrameMetricsData(metrics, handle, aAPZCId);
|
||||
SharedFrameMetricsData* data = new SharedFrameMetricsData(
|
||||
metrics, handle, aLayersId, aAPZCId);
|
||||
mFrameMetricsTable.Put(data->GetViewID(), data);
|
||||
return true;
|
||||
}
|
||||
|
@ -364,9 +366,11 @@ CompositorChild::RecvReleaseSharedCompositorFrameMetrics(
|
|||
CompositorChild::SharedFrameMetricsData::SharedFrameMetricsData(
|
||||
const ipc::SharedMemoryBasic::Handle& metrics,
|
||||
const CrossProcessMutexHandle& handle,
|
||||
const uint32_t& aAPZCId) :
|
||||
mMutex(nullptr),
|
||||
mAPZCId(aAPZCId)
|
||||
const uint64_t& aLayersId,
|
||||
const uint32_t& aAPZCId)
|
||||
: mMutex(nullptr)
|
||||
, mLayersId(aLayersId)
|
||||
, mAPZCId(aAPZCId)
|
||||
{
|
||||
mBuffer = new ipc::SharedMemoryBasic(metrics);
|
||||
mBuffer->Map(sizeof(FrameMetrics));
|
||||
|
@ -403,6 +407,12 @@ CompositorChild::SharedFrameMetricsData::GetViewID()
|
|||
return frame->GetScrollId();
|
||||
}
|
||||
|
||||
uint64_t
|
||||
CompositorChild::SharedFrameMetricsData::GetLayersId() const
|
||||
{
|
||||
return mLayersId;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
CompositorChild::SharedFrameMetricsData::GetAPZCId()
|
||||
{
|
||||
|
|
|
@ -128,6 +128,7 @@ private:
|
|||
|
||||
virtual bool RecvSharedCompositorFrameMetrics(const mozilla::ipc::SharedMemoryBasic::Handle& metrics,
|
||||
const CrossProcessMutexHandle& handle,
|
||||
const uint64_t& aLayersId,
|
||||
const uint32_t& aAPZCId) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvReleaseSharedCompositorFrameMetrics(const ViewID& aId,
|
||||
|
@ -142,12 +143,14 @@ private:
|
|||
SharedFrameMetricsData(
|
||||
const mozilla::ipc::SharedMemoryBasic::Handle& metrics,
|
||||
const CrossProcessMutexHandle& handle,
|
||||
const uint64_t& aLayersId,
|
||||
const uint32_t& aAPZCId);
|
||||
|
||||
~SharedFrameMetricsData();
|
||||
|
||||
void CopyFrameMetrics(FrameMetrics* aFrame);
|
||||
FrameMetrics::ViewID GetViewID();
|
||||
uint64_t GetLayersId() const;
|
||||
uint32_t GetAPZCId();
|
||||
|
||||
private:
|
||||
|
@ -155,6 +158,7 @@ private:
|
|||
// the shared FrameMetrics
|
||||
nsRefPtr<mozilla::ipc::SharedMemoryBasic> mBuffer;
|
||||
CrossProcessMutex* mMutex;
|
||||
uint64_t mLayersId;
|
||||
// Unique ID of the APZC that is sharing the FrameMetrics
|
||||
uint32_t mAPZCId;
|
||||
};
|
||||
|
|
|
@ -133,7 +133,7 @@ parent:
|
|||
child:
|
||||
// Send back Compositor Frame Metrics from APZCs so tiled layers can
|
||||
// update progressively.
|
||||
async SharedCompositorFrameMetrics(Handle metrics, CrossProcessMutexHandle mutex, uint32_t aAPZCId);
|
||||
async SharedCompositorFrameMetrics(Handle metrics, CrossProcessMutexHandle mutex, uint64_t aLayersId, uint32_t aAPZCId);
|
||||
async ReleaseSharedCompositorFrameMetrics(ViewID aId, uint32_t aAPZCId);
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче