diff options
| author | 2019-01-29 14:52:14 -0500 | |
|---|---|---|
| committer | 2019-01-29 21:13:33 -0500 | |
| commit | d9f9bb7552986dff33b5c1906f9743ebdc9b58d1 (patch) | |
| tree | 95edc1f154ebf9637eb188c6ecb434bae91904b0 /src | |
| parent | nvflinger: Use a std::array for the available displays instead of std::vector (diff) | |
| download | yuzu-d9f9bb7552986dff33b5c1906f9743ebdc9b58d1.tar.gz yuzu-d9f9bb7552986dff33b5c1906f9743ebdc9b58d1.tar.xz yuzu-d9f9bb7552986dff33b5c1906f9743ebdc9b58d1.zip | |
nvflinger: Mark locals const where applicable
Makes non-mutable state more explicit.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 5bc0d74e8..b774ce3a5 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -54,8 +54,8 @@ u64 NVFlinger::OpenDisplay(std::string_view name) { | |||
| 54 | // TODO(Subv): Currently we only support the Default display. | 54 | // TODO(Subv): Currently we only support the Default display. |
| 55 | ASSERT(name == "Default"); | 55 | ASSERT(name == "Default"); |
| 56 | 56 | ||
| 57 | auto itr = std::find_if(displays.begin(), displays.end(), | 57 | const auto itr = std::find_if(displays.begin(), displays.end(), |
| 58 | [&](const Display& display) { return display.name == name; }); | 58 | [&](const Display& display) { return display.name == name; }); |
| 59 | 59 | ||
| 60 | ASSERT(itr != displays.end()); | 60 | ASSERT(itr != displays.end()); |
| 61 | 61 | ||
| @@ -67,8 +67,8 @@ u64 NVFlinger::CreateLayer(u64 display_id) { | |||
| 67 | 67 | ||
| 68 | ASSERT_MSG(display.layers.empty(), "Only one layer is supported per display at the moment"); | 68 | ASSERT_MSG(display.layers.empty(), "Only one layer is supported per display at the moment"); |
| 69 | 69 | ||
| 70 | u64 layer_id = next_layer_id++; | 70 | const u64 layer_id = next_layer_id++; |
| 71 | u32 buffer_queue_id = next_buffer_queue_id++; | 71 | const u32 buffer_queue_id = next_buffer_queue_id++; |
| 72 | auto buffer_queue = std::make_shared<BufferQueue>(buffer_queue_id, layer_id); | 72 | auto buffer_queue = std::make_shared<BufferQueue>(buffer_queue_id, layer_id); |
| 73 | display.layers.emplace_back(layer_id, buffer_queue); | 73 | display.layers.emplace_back(layer_id, buffer_queue); |
| 74 | buffer_queues.emplace_back(std::move(buffer_queue)); | 74 | buffer_queues.emplace_back(std::move(buffer_queue)); |
| @@ -85,16 +85,16 @@ Kernel::SharedPtr<Kernel::ReadableEvent> NVFlinger::GetVsyncEvent(u64 display_id | |||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | std::shared_ptr<BufferQueue> NVFlinger::GetBufferQueue(u32 id) const { | 87 | std::shared_ptr<BufferQueue> NVFlinger::GetBufferQueue(u32 id) const { |
| 88 | auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), | 88 | const auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), |
| 89 | [&](const auto& queue) { return queue->GetId() == id; }); | 89 | [&](const auto& queue) { return queue->GetId() == id; }); |
| 90 | 90 | ||
| 91 | ASSERT(itr != buffer_queues.end()); | 91 | ASSERT(itr != buffer_queues.end()); |
| 92 | return *itr; | 92 | return *itr; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | Display& NVFlinger::GetDisplay(u64 display_id) { | 95 | Display& NVFlinger::GetDisplay(u64 display_id) { |
| 96 | auto itr = std::find_if(displays.begin(), displays.end(), | 96 | const auto itr = std::find_if(displays.begin(), displays.end(), |
| 97 | [&](const Display& display) { return display.id == display_id; }); | 97 | [&](const Display& display) { return display.id == display_id; }); |
| 98 | 98 | ||
| 99 | ASSERT(itr != displays.end()); | 99 | ASSERT(itr != displays.end()); |
| 100 | return *itr; | 100 | return *itr; |
| @@ -103,8 +103,8 @@ Display& NVFlinger::GetDisplay(u64 display_id) { | |||
| 103 | Layer& NVFlinger::GetLayer(u64 display_id, u64 layer_id) { | 103 | Layer& NVFlinger::GetLayer(u64 display_id, u64 layer_id) { |
| 104 | auto& display = GetDisplay(display_id); | 104 | auto& display = GetDisplay(display_id); |
| 105 | 105 | ||
| 106 | auto itr = std::find_if(display.layers.begin(), display.layers.end(), | 106 | const auto itr = std::find_if(display.layers.begin(), display.layers.end(), |
| 107 | [&](const Layer& layer) { return layer.id == layer_id; }); | 107 | [&](const Layer& layer) { return layer.id == layer_id; }); |
| 108 | 108 | ||
| 109 | ASSERT(itr != display.layers.end()); | 109 | ASSERT(itr != display.layers.end()); |
| 110 | return *itr; | 110 | return *itr; |
| @@ -139,7 +139,7 @@ void NVFlinger::Compose() { | |||
| 139 | continue; | 139 | continue; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | auto& igbp_buffer = buffer->get().igbp_buffer; | 142 | const auto& igbp_buffer = buffer->get().igbp_buffer; |
| 143 | 143 | ||
| 144 | // Now send the buffer to the GPU for drawing. | 144 | // Now send the buffer to the GPU for drawing. |
| 145 | // TODO(Subv): Support more than just disp0. The display device selection is probably based | 145 | // TODO(Subv): Support more than just disp0. The display device selection is probably based |