
#cleanup Automated patch. This is a no-op. Please avoid, as much as possible, assigning unrelated bugs to this. Context: -------- https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email As of https://crrev.com/1204351, absl::optional is now a type alias for std::optional. We should migrate toward it. This patch: ---------- This applies the rename to ui/ Script: ------- ```` cd ui function replace { echo "Replacing $1 by $2" git grep -l "$1" \ | cut -f1 -d: \ | grep \ -e "\.h" \ -e "\.cc" \ -e "\.mm" \ | sort \ | uniq \ | xargs sed -i "s/$1/$2/g" } replace "absl::make_optional" "std::make_optional" replace "absl::optional" "std::optional" replace "absl::nullopt" "std::nullopt" replace "absl::in_place," "std::in_place," replace "absl::in_place_t," "std::in_place_t," replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>" cd .. git status echo "Formatting" echo "IncludeBlocks: Regroup" >> ".clang-format" echo "IncludeIsMainRegex: \"(_(android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?(_(unit|browser|perf)?tests?)?$\"" >> ".clang-format" git cl format git restore ".clang-format" ``` # Skipping win-presubmit, due to a bug in depot_tools: # See https://g-issues.chromium.org/issues/324293047 NOPRESUBMIT=true CQ_INCLUDE_TRYBOTS=luci.chrome.try:chromeos-betty-pi-arc-chrome AX-Relnotes: n/a. Cleanup: This is a cleanup. Bug: chromium:1500249 Change-Id: I134bbce97a0ae63ae432a5733e934828f8f49c77 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5279376 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1258447}
60 lines
1.6 KiB
C++
60 lines
1.6 KiB
C++
// Copyright 2020 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "ui/gl/gl_display_egl_util.h"
|
|
|
|
#include <optional>
|
|
|
|
#include "base/no_destructor.h"
|
|
#include "base/scoped_environment_variable_override.h"
|
|
|
|
namespace gl {
|
|
|
|
namespace {
|
|
|
|
static GLDisplayEglUtil* g_instance = nullptr;
|
|
|
|
class GLDisplayEglUtilStub : public GLDisplayEglUtil {
|
|
public:
|
|
static GLDisplayEglUtilStub* GetInstance() {
|
|
static base::NoDestructor<GLDisplayEglUtilStub> instance;
|
|
return instance.get();
|
|
}
|
|
void GetPlatformExtraDisplayAttribs(
|
|
EGLenum platform_type,
|
|
std::vector<EGLAttrib>* attributes) override {}
|
|
|
|
void ChoosePlatformCustomAlphaAndBufferSize(EGLint* alpha_size,
|
|
EGLint* buffer_size) override {}
|
|
std::optional<base::ScopedEnvironmentVariableOverride>
|
|
MaybeGetScopedDisplayUnsetForVulkan() override {
|
|
return std::nullopt;
|
|
}
|
|
|
|
private:
|
|
friend base::NoDestructor<GLDisplayEglUtilStub>;
|
|
|
|
GLDisplayEglUtilStub() = default;
|
|
~GLDisplayEglUtilStub() override = default;
|
|
GLDisplayEglUtilStub(const GLDisplayEglUtilStub& util) = delete;
|
|
GLDisplayEglUtilStub& operator=(const GLDisplayEglUtilStub& util) = delete;
|
|
};
|
|
|
|
} // namespace
|
|
|
|
// static
|
|
GLDisplayEglUtil* GLDisplayEglUtil::GetInstance() {
|
|
// If a platform specific impl is not set, create a stub instance.
|
|
if (!g_instance)
|
|
SetInstance(GLDisplayEglUtilStub::GetInstance());
|
|
return g_instance;
|
|
}
|
|
|
|
// static
|
|
void GLDisplayEglUtil::SetInstance(GLDisplayEglUtil* gl_display_util) {
|
|
g_instance = gl_display_util;
|
|
}
|
|
|
|
} // namespace gl
|