[pre-commit.ci] pre-commit autoupdate (#1096)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
71f6da2722
commit
958cdb8206
@@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v14.0.6
|
||||
rev: v16.0.2
|
||||
hooks:
|
||||
- id: clang-format
|
||||
files: '.*\.(hpp|cpp|h)'
|
||||
|
||||
@@ -14,8 +14,9 @@ class Shader;
|
||||
// * Declare a public, unique type name (string_view T::Name)
|
||||
// * Be a final class
|
||||
template <typename T>
|
||||
inline constexpr bool is_shader_v = std::is_base_of_v<gfx::Shader, T>&&
|
||||
std::is_same_v<std::remove_cv_t<decltype(T::Name)>, std::string_view>&& std::is_final_v<T>;
|
||||
inline constexpr bool is_shader_v = std::is_base_of_v<gfx::Shader, T> &&
|
||||
std::is_same_v<std::remove_cv_t<decltype(T::Name)>, std::string_view> &&
|
||||
std::is_final_v<T>;
|
||||
|
||||
/// @brief A shader is used as the base class for all programs across any supported
|
||||
/// backend API. Shaders are registered with a `gfx::ShaderRegistry` instance.
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
// initialized by the platform at linking time.
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define MBGL_CHECK_ERROR(cmd) \
|
||||
([&]() { \
|
||||
struct __MBGL_CHECK_ERROR { \
|
||||
~__MBGL_CHECK_ERROR() noexcept(false) { mbgl::platform::glCheckError(#cmd, __FILE__, __LINE__); } \
|
||||
} __MBGL_CHECK_ERROR; \
|
||||
return cmd; \
|
||||
#define MBGL_CHECK_ERROR(cmd) \
|
||||
([&]() { \
|
||||
struct __MBGL_CHECK_ERROR { \
|
||||
~__MBGL_CHECK_ERROR() noexcept(false) { \
|
||||
mbgl::platform::glCheckError(#cmd, __FILE__, __LINE__); \
|
||||
} \
|
||||
} __MBGL_CHECK_ERROR; \
|
||||
return cmd; \
|
||||
}())
|
||||
#else
|
||||
#define MBGL_CHECK_ERROR(cmd) (cmd)
|
||||
|
||||
@@ -72,12 +72,14 @@ void checkError(const char *cmd, const char *file, int line) {
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define GL_CHECK_ERROR(cmd) \
|
||||
([&]() { \
|
||||
struct __MBGL_C_E { \
|
||||
~__MBGL_C_E() noexcept(false) { checkError(#cmd, __FILE__, __LINE__); } \
|
||||
} __MBGL_C_E; \
|
||||
return cmd; \
|
||||
#define GL_CHECK_ERROR(cmd) \
|
||||
([&]() { \
|
||||
struct __MBGL_C_E { \
|
||||
~__MBGL_C_E() noexcept(false) { \
|
||||
checkError(#cmd, __FILE__, __LINE__); \
|
||||
} \
|
||||
} __MBGL_C_E; \
|
||||
return cmd; \
|
||||
}())
|
||||
#else
|
||||
#define GL_CHECK_ERROR(cmd) (cmd)
|
||||
|
||||
@@ -26,7 +26,7 @@ bool initRuntime(int argc, char* argv[]) {
|
||||
void* vmHandle = dlopen("libart.so", RTLD_NOW);
|
||||
assert(vmHandle != nullptr);
|
||||
|
||||
using CreateJavaVMFn = jint (*)(JavaVM * *vm, JNIEnv * *env, void* vmArgs);
|
||||
using CreateJavaVMFn = jint (*)(JavaVM** vm, JNIEnv** env, void* vmArgs);
|
||||
CreateJavaVMFn createJavaVMFn = reinterpret_cast<CreateJavaVMFn>(dlsym(vmHandle, "JNI_CreateJavaVM"));
|
||||
assert(createJavaVMFn != nullptr);
|
||||
|
||||
@@ -58,7 +58,7 @@ bool initRuntime(int argc, char* argv[]) {
|
||||
void* runtimeHandle = dlopen("libandroid_runtime.so", RTLD_NOW);
|
||||
assert(runtimeHandle != nullptr);
|
||||
|
||||
using RegisterNativesFn = jint (*)(JNIEnv * env);
|
||||
using RegisterNativesFn = jint (*)(JNIEnv* env);
|
||||
RegisterNativesFn registerNativesFn = reinterpret_cast<RegisterNativesFn>(
|
||||
dlsym(runtimeHandle, "registerFrameworkNatives"));
|
||||
assert(registerNativesFn != nullptr);
|
||||
|
||||
@@ -21,13 +21,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
~OSMesaBackendImpl() final {
|
||||
OSMesaDestroyContext(glContext);
|
||||
}
|
||||
~OSMesaBackendImpl() final { OSMesaDestroyContext(glContext); }
|
||||
|
||||
gl::ProcAddress getExtensionFunctionPointer(const char* name) final {
|
||||
return OSMesaGetProcAddress(name);
|
||||
}
|
||||
gl::ProcAddress getExtensionFunctionPointer(const char* name) final { return OSMesaGetProcAddress(name); }
|
||||
|
||||
void activateContext() final {
|
||||
if (!OSMesaMakeCurrent(glContext, &fakeBuffer, GL_UNSIGNED_BYTE, 1, 1)) {
|
||||
|
||||
@@ -11,12 +11,14 @@
|
||||
#include <mbgl/util/traits.hpp>
|
||||
#include <mbgl/util/logging.hpp>
|
||||
|
||||
#define MBGL_CONSTRUCTOR(f) \
|
||||
static void f(void); \
|
||||
struct f##_t_ { \
|
||||
f##_t_(void) { f(); } \
|
||||
}; \
|
||||
static f##_t_ f##_; \
|
||||
#define MBGL_CONSTRUCTOR(f) \
|
||||
static void f(void); \
|
||||
struct f##_t_ { \
|
||||
f##_t_(void) { \
|
||||
f(); \
|
||||
} \
|
||||
}; \
|
||||
static f##_t_ f##_; \
|
||||
static void f(void)
|
||||
|
||||
namespace mapbox {
|
||||
|
||||
@@ -31,13 +31,9 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
static std::size_t arrayLength(const QVariant& value) {
|
||||
return value.toList().size();
|
||||
}
|
||||
static std::size_t arrayLength(const QVariant& value) { return value.toList().size(); }
|
||||
|
||||
static QVariant arrayMember(const QVariant& value, std::size_t i) {
|
||||
return value.toList()[static_cast<int>(i)];
|
||||
}
|
||||
static QVariant arrayMember(const QVariant& value, std::size_t i) { return value.toList()[static_cast<int>(i)]; }
|
||||
|
||||
static bool isObject(const QVariant& value) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
#define MBGL_DEFINE_ATTRIBUTE(type_, n_, name_) \
|
||||
struct name_ { \
|
||||
using Type = ::mbgl::gfx::AttributeType<type_, n_>; \
|
||||
static constexpr auto name() { return #name_; } \
|
||||
static constexpr auto name() { \
|
||||
return #name_; \
|
||||
} \
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
#define MBGL_DEFINE_TEXTURE(name_) \
|
||||
struct name_ { \
|
||||
using Value = ::mbgl::gfx::TextureBinding; \
|
||||
static constexpr auto name() { return #name_; } \
|
||||
#define MBGL_DEFINE_TEXTURE(name_) \
|
||||
struct name_ { \
|
||||
using Value = ::mbgl::gfx::TextureBinding; \
|
||||
static constexpr auto name() { \
|
||||
return #name_; \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -5,22 +5,28 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#define MBGL_DEFINE_UNIFORM_SCALAR(type_, name_) \
|
||||
struct name_ { \
|
||||
using Value = type_; \
|
||||
static constexpr auto name() { return #name_; } \
|
||||
#define MBGL_DEFINE_UNIFORM_SCALAR(type_, name_) \
|
||||
struct name_ { \
|
||||
using Value = type_; \
|
||||
static constexpr auto name() { \
|
||||
return #name_; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define MBGL_DEFINE_UNIFORM_VECTOR(type_, n_, name_) \
|
||||
struct name_ { \
|
||||
using Value = std::array<type_, n_>; \
|
||||
static constexpr auto name() { return #name_; } \
|
||||
#define MBGL_DEFINE_UNIFORM_VECTOR(type_, n_, name_) \
|
||||
struct name_ { \
|
||||
using Value = std::array<type_, n_>; \
|
||||
static constexpr auto name() { \
|
||||
return #name_; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define MBGL_DEFINE_UNIFORM_MATRIX(type_, n_, name_) \
|
||||
struct name_ { \
|
||||
using Value = std::array<type_, n_ * n_>; \
|
||||
static constexpr auto name() { return #name_; } \
|
||||
#define MBGL_DEFINE_UNIFORM_MATRIX(type_, n_, name_) \
|
||||
struct name_ { \
|
||||
using Value = std::array<type_, n_ * n_>; \
|
||||
static constexpr auto name() { \
|
||||
return #name_; \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -673,17 +673,11 @@ protected:
|
||||
texturedShader.detach();
|
||||
}
|
||||
|
||||
void drawShadow() {
|
||||
drawQuad(shadowBuffer, shadowGeometry, texShadow);
|
||||
}
|
||||
void drawShadow() { drawQuad(shadowBuffer, shadowGeometry, texShadow); }
|
||||
|
||||
void drawPuck() {
|
||||
drawQuad(puckBuffer, puckGeometry, texPuck);
|
||||
}
|
||||
void drawPuck() { drawQuad(puckBuffer, puckGeometry, texPuck); }
|
||||
|
||||
void drawHat() {
|
||||
drawQuad(hatBuffer, hatGeometry, texPuckHat);
|
||||
}
|
||||
void drawHat() { drawQuad(hatBuffer, hatGeometry, texPuckHat); }
|
||||
|
||||
static LatLng screenCoordinateToLatLng(const ScreenCoordinate& p,
|
||||
const TransformState& s,
|
||||
|
||||
Reference in New Issue
Block a user