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.
This commit is contained in:
parent
826b1394e8
commit
7e49881b7f
2 changed files with 3 additions and 2 deletions
|
@ -43,7 +43,7 @@ NVFlinger::~NVFlinger() {
|
||||||
CoreTiming::UnscheduleEvent(composition_event, 0);
|
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);
|
LOG_WARNING(Service, "Opening display {}", name);
|
||||||
|
|
||||||
// TODO(Subv): Currently we only support the Default display.
|
// TODO(Subv): Currently we only support the Default display.
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string_view>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include "core/hle/kernel/event.h"
|
#include "core/hle/kernel/event.h"
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ public:
|
||||||
~NVFlinger();
|
~NVFlinger();
|
||||||
|
|
||||||
/// Opens the specified display and returns the id.
|
/// 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.
|
/// Creates a layer on the specified display and returns the layer id.
|
||||||
u64 CreateLayer(u64 display_id);
|
u64 CreateLayer(u64 display_id);
|
||||||
|
|
Loading…
Reference in a new issue