From 7e49881b7f604d1ee267f70405b74ddd9f913791 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 7 Aug 2018 08:19:24 -0400 Subject: nvflinger: Use std::string_view in OpenDisplay() We don't need to use a std::string here, given all that's done is comparing the character sequence against another. This allows passing regular const char* without needing to heap allocate. --- src/core/hle/service/nvflinger/nvflinger.cpp | 2 +- src/core/hle/service/nvflinger/nvflinger.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 0bf51062c..e6848827e 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -43,7 +43,7 @@ NVFlinger::~NVFlinger() { CoreTiming::UnscheduleEvent(composition_event, 0); } -u64 NVFlinger::OpenDisplay(const std::string& name) { +u64 NVFlinger::OpenDisplay(std::string_view name) { LOG_WARNING(Service, "Opening display {}", name); // TODO(Subv): Currently we only support the Default display. diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index 2c908297b..73ad994db 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include "core/hle/kernel/event.h" @@ -41,7 +42,7 @@ public: ~NVFlinger(); /// Opens the specified display and returns the id. - u64 OpenDisplay(const std::string& name); + u64 OpenDisplay(std::string_view name); /// Creates a layer on the specified display and returns the layer id. u64 CreateLayer(u64 display_id); -- cgit v1.2.3 From e40b0cf437bc98a121481b9ea54c472922c05ec4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 7 Aug 2018 08:24:30 -0400 Subject: nvflinger: Get rid of indirect inclusions --- src/core/hle/service/nvflinger/nvflinger.cpp | 3 +++ src/core/hle/service/nvflinger/nvflinger.h | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index e6848827e..1e287ab62 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -3,8 +3,11 @@ // Refer to the license.txt file included. #include +#include #include "common/alignment.h" +#include "common/assert.h" +#include "common/logging/log.h" #include "common/microprofile.h" #include "common/scope_exit.h" #include "core/core.h" diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index 73ad994db..5374df175 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h @@ -5,8 +5,11 @@ #pragma once #include +#include #include -#include +#include + +#include "common/common_types.h" #include "core/hle/kernel/event.h" namespace CoreTiming { -- cgit v1.2.3