From 1d11def9c46dc9c81af01bc55052b51e8028126e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 29 Jan 2019 23:30:22 -0500 Subject: service/nvflinger: Rename Get prefix on function to Find This more accurately describes what the function is actually attempting to do (it's not a simple trivial getter). --- src/core/hle/service/nvflinger/nvflinger.cpp | 16 ++++++++-------- src/core/hle/service/nvflinger/nvflinger.h | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/core/hle/service/nvflinger') diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 6db2cce41..8e2e6b670 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -61,7 +61,7 @@ u64 NVFlinger::OpenDisplay(std::string_view name) { } u64 NVFlinger::CreateLayer(u64 display_id) { - auto& display = GetDisplay(display_id); + auto& display = FindDisplay(display_id); ASSERT_MSG(display.layers.empty(), "Only one layer is supported per display at the moment"); @@ -73,16 +73,16 @@ u64 NVFlinger::CreateLayer(u64 display_id) { return layer_id; } -u32 NVFlinger::GetBufferQueueId(u64 display_id, u64 layer_id) { - const auto& layer = GetLayer(display_id, layer_id); +u32 NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) { + const auto& layer = FindLayer(display_id, layer_id); return layer.buffer_queue->GetId(); } Kernel::SharedPtr NVFlinger::GetVsyncEvent(u64 display_id) { - return GetDisplay(display_id).vsync_event.readable; + return FindDisplay(display_id).vsync_event.readable; } -std::shared_ptr NVFlinger::GetBufferQueue(u32 id) const { +std::shared_ptr NVFlinger::FindBufferQueue(u32 id) const { const auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), [&](const auto& queue) { return queue->GetId() == id; }); @@ -90,7 +90,7 @@ std::shared_ptr NVFlinger::GetBufferQueue(u32 id) const { return *itr; } -Display& NVFlinger::GetDisplay(u64 display_id) { +Display& NVFlinger::FindDisplay(u64 display_id) { const auto itr = std::find_if(displays.begin(), displays.end(), [&](const Display& display) { return display.id == display_id; }); @@ -98,8 +98,8 @@ Display& NVFlinger::GetDisplay(u64 display_id) { return *itr; } -Layer& NVFlinger::GetLayer(u64 display_id, u64 layer_id) { - auto& display = GetDisplay(display_id); +Layer& NVFlinger::FindLayer(u64 display_id, u64 layer_id) { + auto& display = FindDisplay(display_id); const auto itr = std::find_if(display.layers.begin(), display.layers.end(), [&](const Layer& layer) { return layer.id == layer_id; }); diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index 8f9a0a7f8..8880d8485 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h @@ -57,31 +57,31 @@ public: /// Sets the NVDrv module instance to use to send buffers to the GPU. void SetNVDrvInstance(std::shared_ptr instance); - /// Opens the specified display and returns the id. + /// Opens the specified display and returns the ID. u64 OpenDisplay(std::string_view name); - /// Creates a layer on the specified display and returns the layer id. + /// Creates a layer on the specified display and returns the layer ID. u64 CreateLayer(u64 display_id); - /// Gets the buffer queue id of the specified layer in the specified display. - u32 GetBufferQueueId(u64 display_id, u64 layer_id); + /// Finds the buffer queue ID of the specified layer in the specified display. + u32 FindBufferQueueId(u64 display_id, u64 layer_id); /// Gets the vsync event for the specified display. Kernel::SharedPtr GetVsyncEvent(u64 display_id); - /// Obtains a buffer queue identified by the id. - std::shared_ptr GetBufferQueue(u32 id) const; + /// Obtains a buffer queue identified by the ID. + std::shared_ptr FindBufferQueue(u32 id) const; /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when /// finished. void Compose(); private: - /// Returns the display identified by the specified id. - Display& GetDisplay(u64 display_id); + /// Finds the display identified by the specified ID. + Display& FindDisplay(u64 display_id); - /// Returns the layer identified by the specified id in the desired display. - Layer& GetLayer(u64 display_id, u64 layer_id); + /// Finds the layer identified by the specified ID in the desired display. + Layer& FindLayer(u64 display_id, u64 layer_id); std::shared_ptr nvdrv; -- cgit v1.2.3