perf: cache the return value of IsX11()
(#46391)
* perf: cache the return value of IsX11() * fix: mark as nodiscard for those who call, but mark as maybe_unused for Windows
This commit is contained in:
parent
c02e5bc72c
commit
36e233797c
1 changed files with 5 additions and 4 deletions
|
@ -163,10 +163,11 @@ gfx::Size WindowSizeToContentSizeBuggy(HWND hwnd, const gfx::Size& size) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[[maybe_unused]] bool IsX11() {
|
[[maybe_unused, nodiscard]] bool IsX11() {
|
||||||
return ui::OzonePlatform::GetInstance()
|
static const bool is_x11 = ui::OzonePlatform::GetInstance()
|
||||||
->GetPlatformProperties()
|
->GetPlatformProperties()
|
||||||
.electron_can_call_x11;
|
.electron_can_call_x11;
|
||||||
|
return is_x11;
|
||||||
}
|
}
|
||||||
|
|
||||||
class NativeWindowClientView : public views::ClientView {
|
class NativeWindowClientView : public views::ClientView {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue