Add clang-format (#1086)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Bart Louwers
2023-05-01 16:57:37 +02:00
committed by GitHub
parent 403a12bd1b
commit 71f6da2722
1018 changed files with 27876 additions and 25862 deletions

View File

@@ -5,40 +5,32 @@
namespace mbgl {
ProgramParameters::ProgramParameters(const float pixelRatio,
const bool overdraw)
ProgramParameters::ProgramParameters(const float pixelRatio, const bool overdraw)
: defines([&] {
std::string result;
result.reserve(32);
result += "#define DEVICE_PIXEL_RATIO ";
result += util::toString(pixelRatio, true);
result += '\n';
if (overdraw) {
result += "#define OVERDRAW_INSPECTOR\n";
}
return result;
}())
{}
std::string result;
result.reserve(32);
result += "#define DEVICE_PIXEL_RATIO ";
result += util::toString(pixelRatio, true);
result += '\n';
if (overdraw) {
result += "#define OVERDRAW_INSPECTOR\n";
}
return result;
}()) {}
ProgramParameters ProgramParameters::withShaderSource(
const ProgramSource &source) const noexcept
{
ProgramParameters ProgramParameters::withShaderSource(const ProgramSource& source) const noexcept {
assert(gfx::Backend::Type::TYPE_MAX != source.backend);
ProgramParameters params = *this;
params.userSources[static_cast<size_t>(source.backend)]
= source;
params.userSources[static_cast<size_t>(source.backend)] = source;
return params;
}
ProgramParameters ProgramParameters::withDefaultSource(
const ProgramSource &source) const noexcept
{
ProgramParameters ProgramParameters::withDefaultSource(const ProgramSource& source) const noexcept {
assert(gfx::Backend::Type::TYPE_MAX != source.backend);
ProgramParameters params = *this;
params.defaultSources[static_cast<size_t>(source.backend)]
= source;
params.defaultSources[static_cast<size_t>(source.backend)] = source;
return params;
}
@@ -46,8 +38,7 @@ const std::string& ProgramParameters::getDefines() const {
return defines;
}
const std::string&
ProgramParameters::vertexSource(gfx::Backend::Type backend) const {
const std::string& ProgramParameters::vertexSource(gfx::Backend::Type backend) const {
assert(gfx::Backend::Type::TYPE_MAX != backend);
if (userSources[static_cast<size_t>(backend)].vertex.length() > 0) {
@@ -59,8 +50,7 @@ ProgramParameters::vertexSource(gfx::Backend::Type backend) const {
}
}
const std::string&
ProgramParameters::fragmentSource(gfx::Backend::Type backend) const {
const std::string& ProgramParameters::fragmentSource(gfx::Backend::Type backend) const {
assert(gfx::Backend::Type::TYPE_MAX != backend);
if (userSources[static_cast<size_t>(backend)].fragment.length() > 0) {