From f303d56ec5f9b48e33322816bfdb968d295e2306 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Thu, 30 Nov 2017 07:16:21 -0500 Subject: [PATCH] Bug 1406507 - Use an ipc::ByteBuf instead of ByteBuffer to send the DisplayList instead of a ByteBuffer. r=kats DONTBUILD because this is a backout/reland to make sure the code is associated with the right bug. MozReview-Commit-ID: GPQABR9ONld --- gfx/layers/ipc/PWebRenderBridge.ipdl | 2 +- gfx/layers/wr/WebRenderBridgeChild.cpp | 4 +++- gfx/layers/wr/WebRenderBridgeParent.cpp | 4 ++-- gfx/layers/wr/WebRenderBridgeParent.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gfx/layers/ipc/PWebRenderBridge.ipdl b/gfx/layers/ipc/PWebRenderBridge.ipdl index 1e15e7390286..3e1b8eb17775 100644 --- a/gfx/layers/ipc/PWebRenderBridge.ipdl +++ b/gfx/layers/ipc/PWebRenderBridge.ipdl @@ -50,7 +50,7 @@ parent: sync Create(IntSize aSize); async DeleteCompositorAnimations(uint64_t[] aIds); async SetDisplayList(IntSize aSize, WebRenderParentCommand[] commands, OpDestroy[] toDestroy, uint64_t fwdTransactionId, uint64_t transactionId, - LayoutSize aContentSize, ByteBuffer aDL, BuiltDisplayListDescriptor aDLDesc, + LayoutSize aContentSize, ByteBuf aDL, BuiltDisplayListDescriptor aDLDesc, WebRenderScrollData aScrollData, OpUpdateResource[] aResourceUpdates, Shmem[] aSmallShmems, Shmem[] aLargeShmems, IdNamespace aIdNamespace, TimeStamp txnStartTime, TimeStamp fwdTime); diff --git a/gfx/layers/wr/WebRenderBridgeChild.cpp b/gfx/layers/wr/WebRenderBridgeChild.cpp index 358a858aebca..06fb195b7520 100644 --- a/gfx/layers/wr/WebRenderBridgeChild.cpp +++ b/gfx/layers/wr/WebRenderBridgeChild.cpp @@ -144,7 +144,9 @@ WebRenderBridgeChild::EndTransaction(const wr::LayoutSize& aContentSize, MOZ_ASSERT(!mDestroyed); MOZ_ASSERT(mIsInTransaction); - ByteBuffer dlData(Move(aDL.dl)); + ByteBuf dlData(aDL.dl.inner.data, aDL.dl.inner.length, aDL.dl.inner.capacity); + aDL.dl.inner.capacity = 0; + aDL.dl.inner.data = nullptr; TimeStamp fwdTime; #if defined(ENABLE_FRAME_LATENCY_LOG) diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index 1686d45267d0..0766a8c71e97 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -561,7 +561,7 @@ WebRenderBridgeParent::RecvSetDisplayList(const gfx::IntSize& aSize, const uint64_t& aFwdTransactionId, const uint64_t& aTransactionId, const wr::LayoutSize& aContentSize, - const wr::ByteBuffer& dl, + ipc::ByteBuf&& dl, const wr::BuiltDisplayListDescriptor& dlDesc, const WebRenderScrollData& aScrollData, nsTArray&& aResourceUpdates, @@ -609,7 +609,7 @@ WebRenderBridgeParent::RecvSetDisplayList(const gfx::IntSize& aSize, gfx::Color clearColor(0.f, 0.f, 0.f, 0.f); mApi->SetDisplayList(clearColor, wr::NewEpoch(wrEpoch), LayerSize(aSize.width, aSize.height), mPipelineId, aContentSize, - dlDesc, dl.mData, dl.mLength, + dlDesc, dl.mData, dl.mLen, resources); ScheduleComposition(); diff --git a/gfx/layers/wr/WebRenderBridgeParent.h b/gfx/layers/wr/WebRenderBridgeParent.h index d500b7ba71f1..94339b6ab954 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.h +++ b/gfx/layers/wr/WebRenderBridgeParent.h @@ -82,7 +82,7 @@ public: const uint64_t& aFwdTransactionId, const uint64_t& aTransactionId, const wr::LayoutSize& aContentSize, - const wr::ByteBuffer& dl, + ipc::ByteBuf&& dl, const wr::BuiltDisplayListDescriptor& dlDesc, const WebRenderScrollData& aScrollData, nsTArray&& aResourceUpdates,