Loading libs/ui/BufferHubBuffer.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -79,10 +79,10 @@ BufferHubBuffer::BufferHubBuffer(uint32_t width, uint32_t height, uint32_t layer sp<IBufferClient> client; BufferTraits bufferTraits; IBufferHub::allocateBuffer_cb alloc_cb = [&](const auto& status, const auto& outClient, const auto& traits) { const auto& outTraits) { ret = status; client = std::move(outClient); bufferTraits = std::move(traits); bufferTraits = std::move(outTraits); }; if (!bufferhub->allocateBuffer(desc, static_cast<uint32_t>(userMetadataSize), alloc_cb) Loading Loading @@ -116,10 +116,10 @@ BufferHubBuffer::BufferHubBuffer(const sp<NativeHandle>& token) { sp<IBufferClient> client; BufferTraits bufferTraits; IBufferHub::importBuffer_cb import_cb = [&](const auto& status, const auto& outClient, const auto& traits) { const auto& outTraits) { ret = status; client = std::move(outClient); bufferTraits = std::move(traits); bufferTraits = std::move(outTraits); }; // hidl_handle(native_handle_t*) simply creates a raw pointer reference withouth ownership Loading services/bufferhub/BufferHubService.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,13 @@ Return<void> BufferHubService::allocateBuffer(const HardwareBufferDescription& d buildBufferInfo(bufferInfoStorage, node->id(), node->addNewActiveClientsBitToMask(), node->userMetadataSize(), node->metadata().ashmemFd(), node->eventFd().get()); BufferTraits bufferTraits = {/*bufferDesc=*/description, // During the gralloc allocation carried out by BufferNode, gralloc allocator will populate the // fields of its HardwareBufferDescription (i.e. strides) according to the actual // gralloc implementation. We need to read those fields back and send them to the client via // BufferTraits. HardwareBufferDescription allocatedBufferDesc; memcpy(&allocatedBufferDesc, &node->bufferDesc(), sizeof(AHardwareBuffer_Desc)); BufferTraits bufferTraits = {/*bufferDesc=*/allocatedBufferDesc, /*bufferHandle=*/hidl_handle(node->bufferHandle()), /*bufferInfo=*/std::move(bufferInfo)}; Loading Loading
libs/ui/BufferHubBuffer.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -79,10 +79,10 @@ BufferHubBuffer::BufferHubBuffer(uint32_t width, uint32_t height, uint32_t layer sp<IBufferClient> client; BufferTraits bufferTraits; IBufferHub::allocateBuffer_cb alloc_cb = [&](const auto& status, const auto& outClient, const auto& traits) { const auto& outTraits) { ret = status; client = std::move(outClient); bufferTraits = std::move(traits); bufferTraits = std::move(outTraits); }; if (!bufferhub->allocateBuffer(desc, static_cast<uint32_t>(userMetadataSize), alloc_cb) Loading Loading @@ -116,10 +116,10 @@ BufferHubBuffer::BufferHubBuffer(const sp<NativeHandle>& token) { sp<IBufferClient> client; BufferTraits bufferTraits; IBufferHub::importBuffer_cb import_cb = [&](const auto& status, const auto& outClient, const auto& traits) { const auto& outTraits) { ret = status; client = std::move(outClient); bufferTraits = std::move(traits); bufferTraits = std::move(outTraits); }; // hidl_handle(native_handle_t*) simply creates a raw pointer reference withouth ownership Loading
services/bufferhub/BufferHubService.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,13 @@ Return<void> BufferHubService::allocateBuffer(const HardwareBufferDescription& d buildBufferInfo(bufferInfoStorage, node->id(), node->addNewActiveClientsBitToMask(), node->userMetadataSize(), node->metadata().ashmemFd(), node->eventFd().get()); BufferTraits bufferTraits = {/*bufferDesc=*/description, // During the gralloc allocation carried out by BufferNode, gralloc allocator will populate the // fields of its HardwareBufferDescription (i.e. strides) according to the actual // gralloc implementation. We need to read those fields back and send them to the client via // BufferTraits. HardwareBufferDescription allocatedBufferDesc; memcpy(&allocatedBufferDesc, &node->bufferDesc(), sizeof(AHardwareBuffer_Desc)); BufferTraits bufferTraits = {/*bufferDesc=*/allocatedBufferDesc, /*bufferHandle=*/hidl_handle(node->bufferHandle()), /*bufferInfo=*/std::move(bufferInfo)}; Loading