summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger/buffer_queue.cpp
diff options
context:
space:
mode:
authorFrederic L <frederic.laing.development@gmail.com>2018-10-30 05:03:25 +0100
committerbunnei <bunneidev@gmail.com>2018-10-30 05:03:25 +0100
commit7a5eda59146306dedaf3e6f07f97a8c6898543dd (patch)
tree78e07b43fb0113f95e1c8e9426d3b394b9524d4e /src/core/hle/service/nvflinger/buffer_queue.cpp
parentMerge pull request #1621 from lioncash/ipc (diff)
downloadyuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar
yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.gz
yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.bz2
yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.lz
yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.xz
yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.zst
yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index fd98d541d..630ebbfc7 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -31,7 +31,7 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer)
buffer_wait_event->Signal();
}
-boost::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
+std::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
auto itr = std::find_if(queue.begin(), queue.end(), [&](const Buffer& buffer) {
// Only consider free buffers. Buffers become free once again after they've been Acquired
// and Released by the compositor, see the NVFlinger::Compose method.
@@ -44,7 +44,7 @@ boost::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
});
if (itr == queue.end()) {
- return boost::none;
+ return {};
}
itr->status = Buffer::Status::Dequeued;
@@ -70,12 +70,12 @@ void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform,
itr->crop_rect = crop_rect;
}
-boost::optional<const BufferQueue::Buffer&> BufferQueue::AcquireBuffer() {
+std::optional<std::reference_wrapper<const BufferQueue::Buffer>> BufferQueue::AcquireBuffer() {
auto itr = std::find_if(queue.begin(), queue.end(), [](const Buffer& buffer) {
return buffer.status == Buffer::Status::Queued;
});
if (itr == queue.end())
- return boost::none;
+ return {};
itr->status = Buffer::Status::Acquired;
return *itr;
}