From c6a64f2f0cb9cc12c02add1077addabe83dac29b Mon Sep 17 00:00:00 2001 From: kevingpqi Date: Wed, 9 Feb 2022 16:31:51 +0800 Subject: [PATCH 1/3] Add scan code format --- .clang-format | 71 +++++++++++++++++-- .github/workflows/code_format.yml | 24 +++++++ codeformat.sh | 22 ++++++ src/base/File.cpp | 3 +- src/codec/tags/shapes/TrimPaths.cpp | 3 +- src/platform/android/GPUDecoder.cpp | 22 +++--- src/platform/android/GPUDrawable.h | 2 +- src/platform/android/Global.h | 2 +- src/platform/android/JNIHelper.cpp | 4 +- src/platform/android/JPAGImage.cpp | 2 +- src/platform/android/Local.h | 2 +- src/platform/android/PAGText.cpp | 11 ++- src/platform/android/VideoImage.cpp | 2 +- src/platform/android/VideoSurface.cpp | 4 +- src/platform/cocoa/PAG.h | 3 +- src/platform/cocoa/PAGComposition.h | 3 +- src/platform/cocoa/PAGFile.h | 3 +- src/platform/cocoa/PAGFont.h | 3 +- src/platform/cocoa/PAGImage.h | 3 +- src/platform/cocoa/PAGLayer.h | 5 +- src/platform/cocoa/PAGMarker.h | 3 +- src/platform/cocoa/PAGPlayer.h | 3 +- src/platform/cocoa/PAGShapeLayer.h | 3 +- src/platform/cocoa/PAGSolidLayer.h | 3 +- src/platform/cocoa/PAGText.h | 3 +- src/platform/cocoa/PAGTextLayer.h | 3 +- src/platform/cocoa/PAGVideoDecoder.h | 3 +- src/platform/ios/PAGSurface.h | 3 +- src/platform/ios/PAGView.h | 3 +- src/platform/mac/PAGSurface.h | 3 +- src/platform/mac/PAGView.h | 3 +- src/platform/web/GPUDrawable.cpp | 1 - src/platform/web/NativePlatform.cpp | 1 - src/platform/web/VideoSequenceReader.cpp | 10 +-- src/platform/web/VideoSequenceReader.h | 1 - src/rendering/caches/TextContentCache.cpp | 15 ++-- src/rendering/graphics/Picture.cpp | 4 +- src/rendering/graphics/Text.cpp | 3 +- src/rendering/readers/SequenceReader.h | 4 +- .../renderers/CompositionRenderer.cpp | 2 +- src/rendering/utils/PathUtil.h | 2 +- src/video/MediaDemuxer.h | 3 +- test/MultiThreadCase.cpp | 3 +- test/PAGCompositionTest.cpp | 6 +- test/PAGFontTest.cpp | 4 +- test/PAGTimeUtilsTest.cpp | 8 +-- test/framework/PAGCpuTest.cpp | 1 - test/framework/PAGTestEnvironment.cpp | 1 - tgfx/src/gpu/Window.h | 2 +- tgfx/src/gpu/opengl/GLYUVTexture.cpp | 41 +++++------ .../opengl/GLYUVTextureFragmentProcessor.cpp | 3 +- tgfx/src/gpu/opengl/eagl/EAGLProcGetter.h | 1 - tgfx/src/image/webp/WebpUtility.cpp | 2 +- tgfx/src/platform/android/HardwareBuffer.cpp | 2 +- tgfx/src/platform/android/JNIUtil.h | 6 +- tgfx/src/platform/android/NativeImage.cpp | 4 +- tgfx/src/platform/apple/BitmapContextUtil.h | 2 +- tgfx/src/raster/freetype/FTFontData.h | 6 +- tgfx/src/raster/freetype/FTUtil.h | 4 +- tgfx/src/raster/web/WebMask.cpp | 2 +- 60 files changed, 220 insertions(+), 151 deletions(-) create mode 100644 .github/workflows/code_format.yml create mode 100755 codeformat.sh mode change 100755 => 100644 src/platform/ios/PAGView.h mode change 100755 => 100644 src/platform/mac/PAGView.h diff --git a/.clang-format b/.clang-format index 6d2c9bd44e..fcc5c0e9a0 100644 --- a/.clang-format +++ b/.clang-format @@ -1,15 +1,72 @@ +# Generated from CLion C/C++ Code Style settings Language: Cpp BasedOnStyle: Google ColumnLimit: 100 - -# Only sort headers in each include block SortIncludes: true -IncludeBlocks: Preserve -DerivePointerAlignment: false -PointerAlignment: Left +AccessModifierOffset: -1 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignOperands: Align +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Always +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterReturnType: None +AlwaysBreakTemplateDeclarations: Yes +BreakBeforeBraces: Custom BraceWrapping: - SplitEmptyFunction: true + AfterCaseLabel: false + AfterClass: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: true +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +CompactNamespaces: false +ContinuationIndentWidth: 4 +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 2 +KeepEmptyLinesAtTheStartOfBlocks: true +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PointerAlignment: Left +ReflowComments: false +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +IncludeBlocks: Merge +TabWidth: 2 +UseTab: Never --- Language: ObjC @@ -23,4 +80,4 @@ DerivePointerAlignment: false PointerAlignment: Left AllowShortFunctionsOnASingleLine: None BraceWrapping: - SplitEmptyFunction: true + SplitEmptyFunction: true \ No newline at end of file diff --git a/.github/workflows/code_format.yml b/.github/workflows/code_format.yml new file mode 100644 index 0000000000..37a6cbb24c --- /dev/null +++ b/.github/workflows/code_format.yml @@ -0,0 +1,24 @@ +name: code_format + +on: + pull_request: + branches: [ main ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Debug + +jobs: + code_format: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Run codeformat script + run: | + npm install -g clang-format + chmod +x codeformat.sh + ./codeformat.sh + shell: bash diff --git a/codeformat.sh b/codeformat.sh new file mode 100755 index 0000000000..fb5f46805d --- /dev/null +++ b/codeformat.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +echo "----Start code formatting----" +find include/ -iname '*.h' -print0 | xargs clang-format -i +find tgfx/include -iname '*.h' -print0 | xargs clang-format -i +# shellcheck disable=SC2038 +find tgfx/src -iname "*.h" -print -o -iname "*.cpp" -print | xargs clang-format -i +# shellcheck disable=SC2038 +find src -name "*.cpp" -print -o -name "*.h" -print | xargs clang-format -i +# shellcheck disable=SC2038 +find test \( -path test/framework/lzma \) -prune -o -name "*.cpp" -print -o -name "*.h" -print | xargs clang-format -i + +git diff +result=`git diff` +if [[ $result =~ "diff" ]] +then + echo "----Failed to pass coding specification----" + exit 1 +else + echo "----Pass coding specification----" +fi +echo "----Finish code formatting----" + diff --git a/src/base/File.cpp b/src/base/File.cpp index 08aaf4ae4e..1d3d0be5ca 100644 --- a/src/base/File.cpp +++ b/src/base/File.cpp @@ -16,11 +16,10 @@ // ///////////////////////////////////////////////////////////////////////////////////////////////// +#include "pag/file.h" #include #include -#include "pag/file.h" - namespace pag { static std::mutex globalLocker = {}; diff --git a/src/codec/tags/shapes/TrimPaths.cpp b/src/codec/tags/shapes/TrimPaths.cpp index e2a8cdd345..bc003dc768 100644 --- a/src/codec/tags/shapes/TrimPaths.cpp +++ b/src/codec/tags/shapes/TrimPaths.cpp @@ -22,7 +22,8 @@ namespace pag { std::unique_ptr TrimPathsTag(TrimPathsElement* shape) { auto tagConfig = new BlockConfig(TagCode::TrimPaths); AddAttribute(tagConfig, &shape->start, AttributeType::SimpleProperty, 0.0f); - // The default value of the end property should be 1.0f, but for backward compatibility we do not change it. + // The default value of the end property should be 1.0f, but for backward compatibility we do not + // change it. AddAttribute(tagConfig, &shape->end, AttributeType::SimpleProperty, 100.0f); AddAttribute(tagConfig, &shape->offset, AttributeType::SimpleProperty, 0.0f); AddAttribute(tagConfig, &shape->trimType, AttributeType::Value, TrimPathsType::Simultaneously); diff --git a/src/platform/android/GPUDecoder.cpp b/src/platform/android/GPUDecoder.cpp index 7a34aa74a8..a51ef03165 100644 --- a/src/platform/android/GPUDecoder.cpp +++ b/src/platform/android/GPUDecoder.cpp @@ -57,8 +57,8 @@ void GPUDecoder::InitJNI(JNIEnv* env, const std::string& className) { "(Ljava/lang/String;II)Landroid/media/MediaFormat;"); MediaFormat_setByteBuffer = env->GetMethodID(MediaFormatClass.get(), "setByteBuffer", "(Ljava/lang/String;Ljava/nio/ByteBuffer;)V"); - MediaFormat_setFloat = env->GetMethodID(MediaFormatClass.get(), "setFloat", - "(Ljava/lang/String;F)V"); + MediaFormat_setFloat = + env->GetMethodID(MediaFormatClass.get(), "setFloat", "(Ljava/lang/String;F)V"); } GPUDecoder::GPUDecoder(const VideoConfig& config) { @@ -71,14 +71,14 @@ GPUDecoder::GPUDecoder(const VideoConfig& config) { return; } Local outputSurface = {env, videoSurface->getOutputSurface(env)}; - Local decoder = - {env, - env->CallStaticObjectMethod(GPUDecoderClass.get(), GPUDecoder_Create, outputSurface.get())}; + Local decoder = { + env, + env->CallStaticObjectMethod(GPUDecoderClass.get(), GPUDecoder_Create, outputSurface.get())}; if (decoder.empty()) { _isValid = false; return; } - videoDecoder.reset(env,decoder.get()); + videoDecoder.reset(env, decoder.get()); _isValid = onConfigure(decoder.get(), config); } @@ -100,9 +100,9 @@ bool GPUDecoder::onConfigure(jobject decoder, const VideoConfig& config) { return false; } Local mimeType = {env, SafeConvertToJString(env, config.mimeType.c_str())}; - Local mediaFormat = {env, env->CallStaticObjectMethod( - MediaFormatClass.get(), MediaFormat_createVideoFormat, mimeType.get(), config.width, - config.height)}; + Local mediaFormat = { + env, env->CallStaticObjectMethod(MediaFormatClass.get(), MediaFormat_createVideoFormat, + mimeType.get(), config.width, config.height)}; if (config.mimeType == "video/hevc") { if (!config.headers.empty()) { char keyString[] = "csd-0"; @@ -146,8 +146,8 @@ DecodingResult GPUDecoder::onSendBytes(void* bytes, size_t length, int64_t time) return pag::DecodingResult::Error; } Local byteBuffer = {env, env->NewDirectByteBuffer(bytes, length)}; - auto result = env->CallIntMethod(videoDecoder.get(), GPUDecoder_onSendBytes, byteBuffer.get(), - time); + auto result = + env->CallIntMethod(videoDecoder.get(), GPUDecoder_onSendBytes, byteBuffer.get(), time); return static_cast(result); } diff --git a/src/platform/android/GPUDrawable.h b/src/platform/android/GPUDrawable.h index 8bfc0cc8df..0e7cade712 100644 --- a/src/platform/android/GPUDrawable.h +++ b/src/platform/android/GPUDrawable.h @@ -20,8 +20,8 @@ #include #include -#include "pag/pag.h" #include "gpu/opengl/egl/EGLWindow.h" +#include "pag/pag.h" namespace pag { class GPUDrawable : public Drawable { diff --git a/src/platform/android/Global.h b/src/platform/android/Global.h index 4bae229751..e44d26ea34 100644 --- a/src/platform/android/Global.h +++ b/src/platform/android/Global.h @@ -20,7 +20,7 @@ #include "JNIEnvironment.h" -template +template class Global { public: Global() = default; diff --git a/src/platform/android/JNIHelper.cpp b/src/platform/android/JNIHelper.cpp index ffa07c1c8f..34c5bd3916 100644 --- a/src/platform/android/JNIHelper.cpp +++ b/src/platform/android/JNIHelper.cpp @@ -261,8 +261,8 @@ pag::ImageInfo GetImageInfo(JNIEnv* env, jobject bitmap) { return {}; } pag::AlphaType alphaType = (bitmapInfo.flags & BITMAP_FLAGS_ALPHA_UNPREMUL) - ? pag::AlphaType::Unpremultiplied - : pag::AlphaType::Premultiplied; + ? pag::AlphaType::Unpremultiplied + : pag::AlphaType::Premultiplied; pag::ColorType colorType; switch (bitmapInfo.format) { case ANDROID_BITMAP_FORMAT_RGBA_8888: diff --git a/src/platform/android/JPAGImage.cpp b/src/platform/android/JPAGImage.cpp index 0e9ed9d462..08352a93db 100644 --- a/src/platform/android/JPAGImage.cpp +++ b/src/platform/android/JPAGImage.cpp @@ -21,8 +21,8 @@ #include #include #include -#include "NativePlatform.h" #include "JNIHelper.h" +#include "NativePlatform.h" namespace pag { static jfieldID PAGImage_nativeContext; diff --git a/src/platform/android/Local.h b/src/platform/android/Local.h index b6e2f0ee7f..11b1109b36 100644 --- a/src/platform/android/Local.h +++ b/src/platform/android/Local.h @@ -20,7 +20,7 @@ #include -template +template class Local { public: Local() = default; diff --git a/src/platform/android/PAGText.cpp b/src/platform/android/PAGText.cpp index 312cded639..750524b6a2 100644 --- a/src/platform/android/PAGText.cpp +++ b/src/platform/android/PAGText.cpp @@ -86,10 +86,9 @@ jobject ToPAGTextObject(JNIEnv* env, pag::TextDocumentHandle textDocument) { static_cast(textDocument->applyStroke)); env->SetFloatField(textData, PAGText_baselineShift, textDocument->baselineShift); env->SetBooleanField(textData, PAGText_boxText, static_cast(textDocument->boxText)); - Local boxTextRect = {env, MakeRectFObject(env, textDocument->boxTextPos.x, - textDocument->boxTextPos.y, - textDocument->boxTextSize.x, - textDocument->boxTextSize.y)}; + Local boxTextRect = { + env, MakeRectFObject(env, textDocument->boxTextPos.x, textDocument->boxTextPos.y, + textDocument->boxTextSize.x, textDocument->boxTextSize.y)}; env->SetObjectField(textData, PAGText_boxTextRect, boxTextRect.get()); env->SetFloatField(textData, PAGText_firstBaseLine, textDocument->firstBaseLine); env->SetBooleanField(textData, PAGText_fauxBold, static_cast(textDocument->fauxBold)); @@ -147,14 +146,14 @@ TextDocumentHandle ToTextDocument(JNIEnv* env, jobject textData) { (jstring)env->GetObjectField(textData, PAGText_fontFamily)}; textDocument->fontFamily = SafeConvertToStdString(env, fontFamilyObject.get()); Local fontStyleObject = {env, (jstring)env->GetObjectField(textData, PAGText_fontStyle)}; - textDocument->fontStyle = SafeConvertToStdString(env, fontStyleObject.get());; + textDocument->fontStyle = SafeConvertToStdString(env, fontStyleObject.get()); textDocument->fontSize = env->GetFloatField(textData, PAGText_fontSize); jint strokeColorObject = env->GetIntField(textData, PAGText_strokeColor); textDocument->strokeColor = ToColor(env, strokeColorObject); textDocument->strokeOverFill = env->GetBooleanField(textData, PAGText_strokeOverFill); textDocument->strokeWidth = env->GetFloatField(textData, PAGText_strokeWidth); Local textObject = {env, (jstring)env->GetObjectField(textData, PAGText_text)}; - textDocument->text = SafeConvertToStdString(env, textObject.get());; + textDocument->text = SafeConvertToStdString(env, textObject.get()); textDocument->justification = static_cast(env->GetIntField(textData, PAGText_justification)); textDocument->leading = env->GetFloatField(textData, PAGText_leading); diff --git a/src/platform/android/VideoImage.cpp b/src/platform/android/VideoImage.cpp index 6f641ef2c8..c197b9d32a 100644 --- a/src/platform/android/VideoImage.cpp +++ b/src/platform/android/VideoImage.cpp @@ -31,7 +31,7 @@ std::shared_ptr VideoImage::MakeFrom(std::shared_ptr v VideoImage::VideoImage(std::shared_ptr videoSurface, int width, int height) : VideoBuffer(width, height), videoSurface(std::move(videoSurface)) { - this->videoSurface->markHasNewTextureImage(); + this->videoSurface->markHasNewTextureImage(); } std::shared_ptr VideoImage::makeTexture(Context* context) const { diff --git a/src/platform/android/VideoSurface.cpp b/src/platform/android/VideoSurface.cpp index 4e8add547f..503c077c38 100644 --- a/src/platform/android/VideoSurface.cpp +++ b/src/platform/android/VideoSurface.cpp @@ -100,8 +100,8 @@ std::shared_ptr VideoSurface::Make(int width, int height, bool has if (env == nullptr) { return nullptr; } - Local surface = - {env, env->CallStaticObjectMethod(VideoSurfaceClass.get(), VideoSurface_Make, width, height)}; + Local surface = { + env, env->CallStaticObjectMethod(VideoSurfaceClass.get(), VideoSurface_Make, width, height)}; if (surface.empty()) { return nullptr; } diff --git a/src/platform/cocoa/PAG.h b/src/platform/cocoa/PAG.h index f345420abf..5219a3ee0c 100644 --- a/src/platform/cocoa/PAG.h +++ b/src/platform/cocoa/PAG.h @@ -18,8 +18,7 @@ #import -__attribute__((visibility("default"))) -@interface PAG : NSObject +__attribute__((visibility("default"))) @interface PAG : NSObject /** * Get SDK version information. */ diff --git a/src/platform/cocoa/PAGComposition.h b/src/platform/cocoa/PAGComposition.h index 952275ff17..fa99de8d47 100644 --- a/src/platform/cocoa/PAGComposition.h +++ b/src/platform/cocoa/PAGComposition.h @@ -19,8 +19,7 @@ #import #import "PAGLayer.h" -__attribute__((visibility("default"))) -@interface PAGComposition : PAGLayer +__attribute__((visibility("default"))) @interface PAGComposition : PAGLayer /** * Make a empty PAGComposition with specified size. diff --git a/src/platform/cocoa/PAGFile.h b/src/platform/cocoa/PAGFile.h index 96cd707a73..03ed963c79 100644 --- a/src/platform/cocoa/PAGFile.h +++ b/src/platform/cocoa/PAGFile.h @@ -23,8 +23,7 @@ #import "PAGText.h" #import "PAGTimeStretchMode.h" -__attribute__((visibility("default"))) -@interface PAGFile : PAGComposition +__attribute__((visibility("default"))) @interface PAGFile : PAGComposition /** * The maximum tag level current SDK supports. */ diff --git a/src/platform/cocoa/PAGFont.h b/src/platform/cocoa/PAGFont.h index 350c862cef..663fac1c05 100644 --- a/src/platform/cocoa/PAGFont.h +++ b/src/platform/cocoa/PAGFont.h @@ -18,8 +18,7 @@ #import -__attribute__((visibility("default"))) -@interface PAGFont : NSObject +__attribute__((visibility("default"))) @interface PAGFont : NSObject /** * A string with the name of the font family. diff --git a/src/platform/cocoa/PAGImage.h b/src/platform/cocoa/PAGImage.h index c8d9490c30..2dc0c53c7a 100644 --- a/src/platform/cocoa/PAGImage.h +++ b/src/platform/cocoa/PAGImage.h @@ -21,8 +21,7 @@ #import #import "PAGScaleMode.h" -__attribute__((visibility("default"))) -@interface PAGImage : NSObject +__attribute__((visibility("default"))) @interface PAGImage : NSObject /** * Creates a PAGImage object from a CGImage object, return null if it's not valid CGImage object. */ diff --git a/src/platform/cocoa/PAGLayer.h b/src/platform/cocoa/PAGLayer.h index 5eaba9142e..d8a37e0552 100644 --- a/src/platform/cocoa/PAGLayer.h +++ b/src/platform/cocoa/PAGLayer.h @@ -16,8 +16,8 @@ // ///////////////////////////////////////////////////////////////////////////////////////////////// -#import #import +#import #import "PAGMarker.h" typedef NS_ENUM(NSInteger, PAGLayerType) { @@ -33,8 +33,7 @@ typedef NS_ENUM(NSInteger, PAGLayerType) { @class PAGComposition; @class PAGFile; -__attribute__((visibility("default"))) -@interface PAGLayer : NSObject +__attribute__((visibility("default"))) @interface PAGLayer : NSObject /** * Returns the type of layer. diff --git a/src/platform/cocoa/PAGMarker.h b/src/platform/cocoa/PAGMarker.h index fbe3d9ff22..f8231f2c27 100644 --- a/src/platform/cocoa/PAGMarker.h +++ b/src/platform/cocoa/PAGMarker.h @@ -18,8 +18,7 @@ #import -__attribute__((visibility("default"))) -@interface PAGMarker : NSObject +__attribute__((visibility("default"))) @interface PAGMarker : NSObject @property(nonatomic) long long startTime; @property(nonatomic) long long duration; diff --git a/src/platform/cocoa/PAGPlayer.h b/src/platform/cocoa/PAGPlayer.h index c41ea583e2..e7cfa27b5b 100644 --- a/src/platform/cocoa/PAGPlayer.h +++ b/src/platform/cocoa/PAGPlayer.h @@ -23,8 +23,7 @@ #import "PAGScaleMode.h" #import "PAGSurface.h" -__attribute__((visibility("default"))) -@interface PAGPlayer : NSObject +__attribute__((visibility("default"))) @interface PAGPlayer : NSObject /** * Returns the current PAGComposition for PAGPlayer to render as content. */ diff --git a/src/platform/cocoa/PAGShapeLayer.h b/src/platform/cocoa/PAGShapeLayer.h index 5c03e6487e..e6815b3200 100644 --- a/src/platform/cocoa/PAGShapeLayer.h +++ b/src/platform/cocoa/PAGShapeLayer.h @@ -19,7 +19,6 @@ #import #import "PAGLayer.h" -__attribute__((visibility("default"))) -@interface PAGShapeLayer : PAGLayer +__attribute__((visibility("default"))) @interface PAGShapeLayer : PAGLayer @end diff --git a/src/platform/cocoa/PAGSolidLayer.h b/src/platform/cocoa/PAGSolidLayer.h index 9d7d9ba896..71c0f03db2 100644 --- a/src/platform/cocoa/PAGSolidLayer.h +++ b/src/platform/cocoa/PAGSolidLayer.h @@ -20,8 +20,7 @@ #import "CocoaUtils.h" #import "PAGLayer.h" -__attribute__((visibility("default"))) -@interface PAGSolidLayer : PAGLayer +__attribute__((visibility("default"))) @interface PAGSolidLayer : PAGLayer /** * Returns the layer's solid color. diff --git a/src/platform/cocoa/PAGText.h b/src/platform/cocoa/PAGText.h index dddefba2b4..0411d51d9c 100644 --- a/src/platform/cocoa/PAGText.h +++ b/src/platform/cocoa/PAGText.h @@ -32,8 +32,7 @@ enum { /** * The PAGText object stores a value for a TextLayer's Source Text property. */ -__attribute__((visibility("default"))) -@interface PAGText : NSObject +__attribute__((visibility("default"))) @interface PAGText : NSObject /** * When true, the text layer shows a fill. diff --git a/src/platform/cocoa/PAGTextLayer.h b/src/platform/cocoa/PAGTextLayer.h index c5f080658f..34f73d1836 100644 --- a/src/platform/cocoa/PAGTextLayer.h +++ b/src/platform/cocoa/PAGTextLayer.h @@ -22,8 +22,7 @@ @class PAGFont; -__attribute__((visibility("default"))) -@interface PAGTextLayer : PAGLayer +__attribute__((visibility("default"))) @interface PAGTextLayer : PAGLayer /** * Returns the TextLayer’s fill color. diff --git a/src/platform/cocoa/PAGVideoDecoder.h b/src/platform/cocoa/PAGVideoDecoder.h index 3089eacd24..586401a36a 100644 --- a/src/platform/cocoa/PAGVideoDecoder.h +++ b/src/platform/cocoa/PAGVideoDecoder.h @@ -18,8 +18,7 @@ #import -__attribute__((visibility("default"))) -@interface PAGVideoDecoder : NSObject +__attribute__((visibility("default"))) @interface PAGVideoDecoder : NSObject /** * Register a software decoder factory to implement the decoder fallback mechanism. diff --git a/src/platform/ios/PAGSurface.h b/src/platform/ios/PAGSurface.h index 1e6c6674a8..8a26bb60e1 100644 --- a/src/platform/ios/PAGSurface.h +++ b/src/platform/ios/PAGSurface.h @@ -22,8 +22,7 @@ #import #import "PAGImageLayer.h" -__attribute__((visibility("default"))) -@interface PAGSurface : NSObject +__attribute__((visibility("default"))) @interface PAGSurface : NSObject /** * Creates a new PAGSurface from specified CAEAGLLayer. The GPU context will be created internally diff --git a/src/platform/ios/PAGView.h b/src/platform/ios/PAGView.h old mode 100755 new mode 100644 index 62578995c4..ef707a52c4 --- a/src/platform/ios/PAGView.h +++ b/src/platform/ios/PAGView.h @@ -66,8 +66,7 @@ @end -__attribute__((visibility("default"))) -@interface PAGView : UIView +__attribute__((visibility("default"))) @interface PAGView : UIView /** * Default is NO. diff --git a/src/platform/mac/PAGSurface.h b/src/platform/mac/PAGSurface.h index 32a70af18d..45d388ada6 100644 --- a/src/platform/mac/PAGSurface.h +++ b/src/platform/mac/PAGSurface.h @@ -23,8 +23,7 @@ #import #import "PAGImageLayer.h" -__attribute__((visibility("default"))) -@interface PAGSurface : NSObject +__attribute__((visibility("default"))) @interface PAGSurface : NSObject + (PAGSurface*)FromView:(NSView*)view; diff --git a/src/platform/mac/PAGView.h b/src/platform/mac/PAGView.h old mode 100755 new mode 100644 index c15a5ee534..5af4b962a2 --- a/src/platform/mac/PAGView.h +++ b/src/platform/mac/PAGView.h @@ -66,8 +66,7 @@ @end -__attribute__((visibility("default"))) -@interface PAGView : NSView +__attribute__((visibility("default"))) @interface PAGView : NSView /** * Adds a listener to the set of listeners that are sent events through the life of an animation, diff --git a/src/platform/web/GPUDrawable.cpp b/src/platform/web/GPUDrawable.cpp index 9e6699f195..5fd2cccb6a 100644 --- a/src/platform/web/GPUDrawable.cpp +++ b/src/platform/web/GPUDrawable.cpp @@ -17,7 +17,6 @@ ///////////////////////////////////////////////////////////////////////////////////////////////// #include "GPUDrawable.h" - #include "gpu/Surface.h" #include "gpu/opengl/GLDefines.h" diff --git a/src/platform/web/NativePlatform.cpp b/src/platform/web/NativePlatform.cpp index f11c927a31..8015fcef01 100644 --- a/src/platform/web/NativePlatform.cpp +++ b/src/platform/web/NativePlatform.cpp @@ -17,7 +17,6 @@ ///////////////////////////////////////////////////////////////////////////////////////////////// #include "NativePlatform.h" - #include using namespace emscripten; diff --git a/src/platform/web/VideoSequenceReader.cpp b/src/platform/web/VideoSequenceReader.cpp index 1194d468f5..1b9deddabd 100644 --- a/src/platform/web/VideoSequenceReader.cpp +++ b/src/platform/web/VideoSequenceReader.cpp @@ -17,15 +17,15 @@ ///////////////////////////////////////////////////////////////////////////////////////////////// #include "VideoSequenceReader.h" - #include "gpu/opengl/GLTexture.h" #include "rendering/caches/RenderCache.h" using namespace emscripten; namespace pag { -std::shared_ptr -SequenceReader::Make(std::shared_ptr file, VideoSequence* sequence, DecodingPolicy policy) { +std::shared_ptr SequenceReader::Make(std::shared_ptr file, + VideoSequence* sequence, + DecodingPolicy policy) { return std::make_shared(std::move(file), sequence, policy); } @@ -43,12 +43,12 @@ VideoSequenceReader::VideoSequenceReader(std::shared_ptr file, VideoSequen auto videoReaderClass = val::module_property("VideoReader"); if (videoReaderClass.as()) { auto headers = val::array(); - for (auto* header: sequence->headers) { + for (auto* header : sequence->headers) { headers.call("push", val(typed_memory_view(header->length(), header->data()))); } auto frames = val::array(); auto ptsList = val::array(); - for (auto* frame: sequence->frames) { + for (auto* frame : sequence->frames) { frames.call( "push", val(typed_memory_view(frame->fileBytes->length(), frame->fileBytes->data()))); ptsList.call("push", static_cast(frame->frame)); diff --git a/src/platform/web/VideoSequenceReader.h b/src/platform/web/VideoSequenceReader.h index c76818a9ba..d48f976a7a 100644 --- a/src/platform/web/VideoSequenceReader.h +++ b/src/platform/web/VideoSequenceReader.h @@ -19,7 +19,6 @@ #pragma once #include - #include "rendering/readers/SequenceReader.h" namespace pag { diff --git a/src/rendering/caches/TextContentCache.cpp b/src/rendering/caches/TextContentCache.cpp index 3c2abbcdf0..944e96502e 100644 --- a/src/rendering/caches/TextContentCache.cpp +++ b/src/rendering/caches/TextContentCache.cpp @@ -22,21 +22,14 @@ namespace pag { TextContentCache::TextContentCache(TextLayer* layer) - : ContentCache(layer), - sourceText(layer->sourceText), - pathOption(layer->pathOption), - moreOption(layer->moreOption), - animators(&layer->animators) { + : ContentCache(layer), sourceText(layer->sourceText), pathOption(layer->pathOption), + moreOption(layer->moreOption), animators(&layer->animators) { } TextContentCache::TextContentCache(TextLayer* layer, ID cacheID, Property* sourceText) - : ContentCache(layer), - cacheID(cacheID), - sourceText(sourceText), - pathOption(layer->pathOption), - moreOption(layer->moreOption), - animators(&layer->animators) { + : ContentCache(layer), cacheID(cacheID), sourceText(sourceText), pathOption(layer->pathOption), + moreOption(layer->moreOption), animators(&layer->animators) { } void TextContentCache::excludeVaryingRanges(std::vector* timeRanges) const { diff --git a/src/rendering/graphics/Picture.cpp b/src/rendering/graphics/Picture.cpp index cc22377271..3db4e2031e 100644 --- a/src/rendering/graphics/Picture.cpp +++ b/src/rendering/graphics/Picture.cpp @@ -417,9 +417,7 @@ class ImageTextureProxy : public TextureProxy { class BackendTextureProxy : public TextureProxy { public: BackendTextureProxy(const BackendTexture& texture, ImageOrigin origin, void* sharedContext) - : TextureProxy(texture.width(), texture.height()), - backendTexture(texture), - origin(origin), + : TextureProxy(texture.width(), texture.height()), backendTexture(texture), origin(origin), sharedContext(sharedContext) { } diff --git a/src/rendering/graphics/Text.cpp b/src/rendering/graphics/Text.cpp index f98a6cbf15..6423992a6f 100644 --- a/src/rendering/graphics/Text.cpp +++ b/src/rendering/graphics/Text.cpp @@ -16,9 +16,8 @@ // ///////////////////////////////////////////////////////////////////////////////////////////////// -#include - #include "Text.h" +#include #include "core/Canvas.h" #include "pag/file.h" #include "raster/PathEffect.h" diff --git a/src/rendering/readers/SequenceReader.h b/src/rendering/readers/SequenceReader.h index f671ad7034..84ce57396a 100644 --- a/src/rendering/readers/SequenceReader.h +++ b/src/rendering/readers/SequenceReader.h @@ -28,8 +28,8 @@ class RenderCache; class SequenceReader { public: - static std::shared_ptr - Make(std::shared_ptr file, VideoSequence* sequence, DecodingPolicy policy); + static std::shared_ptr Make(std::shared_ptr file, VideoSequence* sequence, + DecodingPolicy policy); SequenceReader(std::shared_ptr file, Sequence* sequence); diff --git a/src/rendering/renderers/CompositionRenderer.cpp b/src/rendering/renderers/CompositionRenderer.cpp index da421edf93..0f7c06949a 100644 --- a/src/rendering/renderers/CompositionRenderer.cpp +++ b/src/rendering/renderers/CompositionRenderer.cpp @@ -69,7 +69,7 @@ static std::shared_ptr MakeVideoSequenceGraphic(VideoSequence* sequence RGBAAALayout layout = {sequence->width, sequence->height, sequence->alphaStartX, sequence->alphaStartY}; return Picture::MakeFrom(sequence->composition->uniqueID, std::unique_ptr(proxy), - layout); + layout); } std::shared_ptr RenderVectorComposition(VectorComposition* composition, diff --git a/src/rendering/utils/PathUtil.h b/src/rendering/utils/PathUtil.h index 1a9ac773e0..4c875547e6 100644 --- a/src/rendering/utils/PathUtil.h +++ b/src/rendering/utils/PathUtil.h @@ -18,8 +18,8 @@ #pragma once -#include "raster/Path.h" #include "pag/file.h" +#include "raster/Path.h" namespace pag { diff --git a/src/video/MediaDemuxer.h b/src/video/MediaDemuxer.h index 45fb756dec..2ae9cd1cce 100644 --- a/src/video/MediaDemuxer.h +++ b/src/video/MediaDemuxer.h @@ -46,8 +46,7 @@ class SampleData { class PTSDetail { public: PTSDetail(int64_t duration, std::vector ptsVector, std::vector keyframeIndexVector) - : duration(duration), - ptsVector(std::move(ptsVector)), + : duration(duration), ptsVector(std::move(ptsVector)), keyframeIndexVector(std::move(keyframeIndexVector)) { } int64_t duration = 0; diff --git a/test/MultiThreadCase.cpp b/test/MultiThreadCase.cpp index a854614e17..b2129b03b5 100644 --- a/test/MultiThreadCase.cpp +++ b/test/MultiThreadCase.cpp @@ -114,7 +114,8 @@ PAG_TEST_F(MultiThreadCase, AsyncFlushAndFreeCache) { } /** - * 用例描述: 多线程HitTest相关,因为flush线程会不停刷新位置,所以另外一个线程来测试hit的准确性没有意义,此处更多是看 + * 用例描述: + * 多线程HitTest相关,因为flush线程会不停刷新位置,所以另外一个线程来测试hit的准确性没有意义,此处更多是看 * 多线程会不会引起死锁之类的问题,正确性是HitTest接口本身来保证 */ PAG_TEST_F(MultiThreadCase, HitTestPoint) { diff --git a/test/PAGCompositionTest.cpp b/test/PAGCompositionTest.cpp index a6a834cfd9..6b56961e16 100644 --- a/test/PAGCompositionTest.cpp +++ b/test/PAGCompositionTest.cpp @@ -58,8 +58,7 @@ PAG_TEST_F(PAGCompositionTest, composition) { pagComposition->setLayerIndex(imageLayer1, 3); TestPAGPlayer->flush(); - EXPECT_TRUE( - Baseline::Compare(TestPAGSurface, "PAGCompositionTest/composition_setLayerIndex")); + EXPECT_TRUE(Baseline::Compare(TestPAGSurface, "PAGCompositionTest/composition_setLayerIndex")); pagComposition->removeLayer(imageLayer1); TestPAGPlayer->flush(); @@ -67,8 +66,7 @@ PAG_TEST_F(PAGCompositionTest, composition) { pagComposition->removeLayerAt(2); TestPAGPlayer->flush(); - EXPECT_TRUE( - Baseline::Compare(TestPAGSurface, "PAGCompositionTest/composition_removeLayerAt")); + EXPECT_TRUE(Baseline::Compare(TestPAGSurface, "PAGCompositionTest/composition_removeLayerAt")); pagComposition->removeAllLayers(); TestPAGPlayer->flush(); diff --git a/test/PAGFontTest.cpp b/test/PAGFontTest.cpp index 37b001a859..609fdc0f47 100644 --- a/test/PAGFontTest.cpp +++ b/test/PAGFontTest.cpp @@ -48,8 +48,8 @@ PAG_TEST(PAGFontTest, TestFont) { pagPlayer->setProgress((currentFrame + 0.1) * 1.0 / totalFrames); pagPlayer->flush(); - bool same = Baseline::Compare(pagSurface, - "PAGFontTest/TestFont_" + std::to_string(currentFrame)); + bool same = + Baseline::Compare(pagSurface, "PAGFontTest/TestFont_" + std::to_string(currentFrame)); if (!same) { errorMsg += (std::to_string(currentFrame) + ";"); } diff --git a/test/PAGTimeUtilsTest.cpp b/test/PAGTimeUtilsTest.cpp index cf8c8770db..d55cb0da4a 100644 --- a/test/PAGTimeUtilsTest.cpp +++ b/test/PAGTimeUtilsTest.cpp @@ -38,13 +38,13 @@ PAG_TEST_F(PAGTimeUtilsTest, ConvertProgressAndFrame) { auto progress = i * 0.5 / totalFrames; pagFile->setProgress(progress); TestPAGPlayer->flush(); - EXPECT_TRUE(Baseline::Compare( - TestPAGSurface, "PAGTimeUtilsTest/ConvertProgressAndFrame_" + std::to_string(i))); + EXPECT_TRUE(Baseline::Compare(TestPAGSurface, + "PAGTimeUtilsTest/ConvertProgressAndFrame_" + std::to_string(i))); progress = pagFile->getProgress(); pagFile->setProgress(progress); TestPAGPlayer->flush(); - EXPECT_TRUE(Baseline::Compare( - TestPAGSurface, "PAGTimeUtilsTest/ConvertProgressAndFrame_" + std::to_string(i))); + EXPECT_TRUE(Baseline::Compare(TestPAGSurface, + "PAGTimeUtilsTest/ConvertProgressAndFrame_" + std::to_string(i))); } } diff --git a/test/framework/PAGCpuTest.cpp b/test/framework/PAGCpuTest.cpp index 6b6b84159d..e97d63fae9 100644 --- a/test/framework/PAGCpuTest.cpp +++ b/test/framework/PAGCpuTest.cpp @@ -21,7 +21,6 @@ #include "gtest/gtest.h" #include "utils/PAGTestUtils.h" - namespace pag { std::shared_ptr PAGCpuTest::TestPAGFile = nullptr; diff --git a/test/framework/PAGTestEnvironment.cpp b/test/framework/PAGTestEnvironment.cpp index 72112aaa15..83ca2d6794 100644 --- a/test/framework/PAGTestEnvironment.cpp +++ b/test/framework/PAGTestEnvironment.cpp @@ -40,7 +40,6 @@ void PAGTestEnvironment::SetUp() { } void PAGTestEnvironment::TearDown() { - } } // namespace pag diff --git a/tgfx/src/gpu/Window.h b/tgfx/src/gpu/Window.h index 67a7fa39c0..269ee657a0 100644 --- a/tgfx/src/gpu/Window.h +++ b/tgfx/src/gpu/Window.h @@ -18,8 +18,8 @@ #pragma once -#include "gpu/Surface.h" #include "gpu/Context.h" +#include "gpu/Surface.h" namespace pag { /** diff --git a/tgfx/src/gpu/opengl/GLYUVTexture.cpp b/tgfx/src/gpu/opengl/GLYUVTexture.cpp index 21da2cecc4..27bac4dd75 100644 --- a/tgfx/src/gpu/opengl/GLYUVTexture.cpp +++ b/tgfx/src/gpu/opengl/GLYUVTexture.cpp @@ -26,10 +26,13 @@ namespace pag { #define NV12_PIXEL_BYTES 1.5 struct YUVConfig { - YUVConfig(YUVColorSpace colorSpace, YUVColorRange colorRange, - int width, int height, int planeCount) - : colorSpace(colorSpace), colorRange(colorRange), - width(width), height(height), planeCount(planeCount) { + YUVConfig(YUVColorSpace colorSpace, YUVColorRange colorRange, int width, int height, + int planeCount) + : colorSpace(colorSpace), + colorRange(colorRange), + width(width), + height(height), + planeCount(planeCount) { } YUVColorSpace colorSpace; YUVColorRange colorRange; @@ -127,10 +130,9 @@ static void SubmitYUVTexture(const GLInterface* gl, const YUVConfig& yuvConfig, } } -std::shared_ptr YUVTexture::MakeI420(Context* context, - YUVColorSpace colorSpace, YUVColorRange colorRange, - int width, int height, uint8_t* pixelsPlane[3], - const int lineSize[3]) { +std::shared_ptr YUVTexture::MakeI420(Context* context, YUVColorSpace colorSpace, + YUVColorRange colorRange, int width, int height, + uint8_t* pixelsPlane[3], const int lineSize[3]) { auto gl = GLContext::Unwrap(context); GLStateGuard stateGuard(context); @@ -152,9 +154,9 @@ std::shared_ptr YUVTexture::MakeI420(Context* context, if (texturePlanes.empty()) { return nullptr; } - texture = std::static_pointer_cast(Resource::Wrap( - context, new GLI420Texture(yuvConfig.colorSpace, yuvConfig.colorRange, - yuvConfig.width, yuvConfig.height))); + texture = std::static_pointer_cast( + Resource::Wrap(context, new GLI420Texture(yuvConfig.colorSpace, yuvConfig.colorRange, + yuvConfig.width, yuvConfig.height))); texture->samplers.emplace_back(pixelConfig, texturePlanes[0]); texture->samplers.emplace_back(pixelConfig, texturePlanes[1]); texture->samplers.emplace_back(pixelConfig, texturePlanes[2]); @@ -163,10 +165,9 @@ std::shared_ptr YUVTexture::MakeI420(Context* context, return texture; } -std::shared_ptr YUVTexture::MakeNV12(Context* context, - YUVColorSpace colorSpace, YUVColorRange colorRange, - int width, int height, uint8_t* pixelsPlane[2], - const int lineSize[2]) { +std::shared_ptr YUVTexture::MakeNV12(Context* context, YUVColorSpace colorSpace, + YUVColorRange colorRange, int width, int height, + uint8_t* pixelsPlane[2], const int lineSize[2]) { auto gl = GLContext::Unwrap(context); GLStateGuard stateGuard(context); @@ -188,9 +189,9 @@ std::shared_ptr YUVTexture::MakeNV12(Context* context, if (texturePlanes.empty()) { return nullptr; } - texture = std::static_pointer_cast(Resource::Wrap( - context, new GLNV12Texture(yuvConfig.colorSpace, yuvConfig.colorRange, - yuvConfig.width, yuvConfig.height))); + texture = std::static_pointer_cast( + Resource::Wrap(context, new GLNV12Texture(yuvConfig.colorSpace, yuvConfig.colorRange, + yuvConfig.width, yuvConfig.height))); texture->samplers.emplace_back(pixelConfig[0], texturePlanes[0]); texture->samplers.emplace_back(pixelConfig[1], texturePlanes[1]); } @@ -198,8 +199,8 @@ std::shared_ptr YUVTexture::MakeNV12(Context* context, return texture; } -GLYUVTexture::GLYUVTexture(YUVColorSpace colorSpace, YUVColorRange colorRange, - int width, int height) +GLYUVTexture::GLYUVTexture(YUVColorSpace colorSpace, YUVColorRange colorRange, int width, + int height) : YUVTexture(colorSpace, colorRange, width, height) { } diff --git a/tgfx/src/gpu/opengl/GLYUVTextureFragmentProcessor.cpp b/tgfx/src/gpu/opengl/GLYUVTextureFragmentProcessor.cpp index 88425c58a1..cf344b6f8e 100644 --- a/tgfx/src/gpu/opengl/GLYUVTextureFragmentProcessor.cpp +++ b/tgfx/src/gpu/opengl/GLYUVTextureFragmentProcessor.cpp @@ -132,8 +132,7 @@ void GLYUVTextureFragmentProcessor::onSetData(const ProgramDataManager& programD } case YUVColorSpace::Rec2020: { if (yuvFP.texture->colorRange() == YUVColorRange::JPEG) { - programDataManager.setMatrix3f(mat3ColorConversionUniform, - kColorConversion2020FullRange); + programDataManager.setMatrix3f(mat3ColorConversionUniform, kColorConversion2020FullRange); } else { programDataManager.setMatrix3f(mat3ColorConversionUniform, kColorConversion2020LimitRange); diff --git a/tgfx/src/gpu/opengl/eagl/EAGLProcGetter.h b/tgfx/src/gpu/opengl/eagl/EAGLProcGetter.h index 6115cd7431..342daa4987 100644 --- a/tgfx/src/gpu/opengl/eagl/EAGLProcGetter.h +++ b/tgfx/src/gpu/opengl/eagl/EAGLProcGetter.h @@ -33,4 +33,3 @@ class EAGLProcGetter : public GLProcGetter { void* fLibrary; }; } // namespace pag - diff --git a/tgfx/src/image/webp/WebpUtility.cpp b/tgfx/src/image/webp/WebpUtility.cpp index 2aa9231d67..84c5097256 100644 --- a/tgfx/src/image/webp/WebpUtility.cpp +++ b/tgfx/src/image/webp/WebpUtility.cpp @@ -19,8 +19,8 @@ #include "image/webp/WebpUtility.h" #include #include -#include "image/utils/OrientationHelper.h" #include "base/utils/Log.h" +#include "image/utils/OrientationHelper.h" #include "webp/decode.h" #include "webp/demux.h" #include "webp/encode.h" diff --git a/tgfx/src/platform/android/HardwareBuffer.cpp b/tgfx/src/platform/android/HardwareBuffer.cpp index a5138a4c58..c3cf6e3820 100644 --- a/tgfx/src/platform/android/HardwareBuffer.cpp +++ b/tgfx/src/platform/android/HardwareBuffer.cpp @@ -39,7 +39,7 @@ std::shared_ptr HardwareBuffer::Make(int width, int height, bool al 1, AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM, AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN | AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN | - AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE | AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT, + AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE | AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT, 0, 0, 0}; diff --git a/tgfx/src/platform/android/JNIUtil.h b/tgfx/src/platform/android/JNIUtil.h index 98d5a29d29..981542b8f1 100644 --- a/tgfx/src/platform/android/JNIUtil.h +++ b/tgfx/src/platform/android/JNIUtil.h @@ -18,8 +18,8 @@ #pragma once -#include #include +#include namespace pag { /** @@ -34,7 +34,7 @@ JNIEnv* CurrentJNIEnv(); */ jstring SafeToJString(JNIEnv* env, const std::string& text); -template +template class Global { public: Global() = default; @@ -84,7 +84,7 @@ class Global { T _ref = nullptr; }; -template +template class Local { public: Local() = default; diff --git a/tgfx/src/platform/android/NativeImage.cpp b/tgfx/src/platform/android/NativeImage.cpp index da3728ba09..590be3e0f7 100644 --- a/tgfx/src/platform/android/NativeImage.cpp +++ b/tgfx/src/platform/android/NativeImage.cpp @@ -185,8 +185,8 @@ static ImageInfo GetImageInfo(JNIEnv* env, jobject bitmap) { return {}; } AlphaType alphaType = (bitmapInfo.flags & BITMAP_FLAGS_ALPHA_UNPREMUL) - ? AlphaType::Unpremultiplied - : AlphaType::Premultiplied; + ? AlphaType::Unpremultiplied + : AlphaType::Premultiplied; ColorType colorType; switch (bitmapInfo.format) { case ANDROID_BITMAP_FORMAT_RGBA_8888: diff --git a/tgfx/src/platform/apple/BitmapContextUtil.h b/tgfx/src/platform/apple/BitmapContextUtil.h index 1d90402b79..b904b1928e 100644 --- a/tgfx/src/platform/apple/BitmapContextUtil.h +++ b/tgfx/src/platform/apple/BitmapContextUtil.h @@ -19,8 +19,8 @@ #pragma once #include -#include "pag/types.h" #include "image/ImageInfo.h" +#include "pag/types.h" namespace pag { CGContextRef CreateBitmapContext(const ImageInfo& info, void* pixels); diff --git a/tgfx/src/raster/freetype/FTFontData.h b/tgfx/src/raster/freetype/FTFontData.h index 6a80764cb4..17b07ab6fa 100644 --- a/tgfx/src/raster/freetype/FTFontData.h +++ b/tgfx/src/raster/freetype/FTFontData.h @@ -23,10 +23,12 @@ namespace pag { struct FTFontData { - FTFontData(std::string path, int ttcIndex) : path(std::move(path)), ttcIndex(ttcIndex) {} + FTFontData(std::string path, int ttcIndex) : path(std::move(path)), ttcIndex(ttcIndex) { + } FTFontData(const void* data, size_t length, int ttcIndex) - : data(ByteData::MakeCopy(data, length)), ttcIndex(ttcIndex) {} + : data(ByteData::MakeCopy(data, length)), ttcIndex(ttcIndex) { + } std::string path; std::unique_ptr data; diff --git a/tgfx/src/raster/freetype/FTUtil.h b/tgfx/src/raster/freetype/FTUtil.h index ac8e0146ef..d3b7b1dfd4 100644 --- a/tgfx/src/raster/freetype/FTUtil.h +++ b/tgfx/src/raster/freetype/FTUtil.h @@ -40,8 +40,8 @@ inline FT_F26Dot6 FDot6Ceil(FT_F26Dot6 x) { return ((x) + 63) >> 6; } -inline FT_F26Dot6 FDot6Round(FT_F26Dot6 x) { - return (((x) + 32) >> 6); +inline FT_F26Dot6 FDot6Round(FT_F26Dot6 x) { + return (((x) + 32) >> 6); } class FTLibrary { diff --git a/tgfx/src/raster/web/WebMask.cpp b/tgfx/src/raster/web/WebMask.cpp index 7f95c66f41..b7e336541c 100644 --- a/tgfx/src/raster/web/WebMask.cpp +++ b/tgfx/src/raster/web/WebMask.cpp @@ -18,9 +18,9 @@ #include "WebMask.h" +#include "WebTextBlob.h" #include "WebTypeface.h" #include "gpu/opengl/GLTexture.h" -#include "WebTextBlob.h" using namespace emscripten; From fc978b7fe60d9bf669242a20f279809be6b9ddac Mon Sep 17 00:00:00 2001 From: kevingpqi Date: Wed, 9 Feb 2022 16:43:06 +0800 Subject: [PATCH 2/3] Modify annotation information --- codeformat.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codeformat.sh b/codeformat.sh index fb5f46805d..b058c55537 100755 --- a/codeformat.sh +++ b/codeformat.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -echo "----Start code formatting----" +echo "----begin to scan code format----" find include/ -iname '*.h' -print0 | xargs clang-format -i find tgfx/include -iname '*.h' -print0 | xargs clang-format -i # shellcheck disable=SC2038 @@ -13,10 +13,10 @@ git diff result=`git diff` if [[ $result =~ "diff" ]] then - echo "----Failed to pass coding specification----" + echo "----Failed----" exit 1 else - echo "----Pass coding specification----" + echo "----Success----" fi -echo "----Finish code formatting----" +echo "----Complete the scan code format-----" From 7700b7798f16274bb2e863bdb7f6b0666d08363f Mon Sep 17 00:00:00 2001 From: kevingpqi Date: Wed, 9 Feb 2022 17:08:33 +0800 Subject: [PATCH 3/3] Format codes --- codeformat.sh | 2 +- src/platform/cocoa/PAG.h | 3 +- src/platform/cocoa/PAGComposition.h | 3 +- src/platform/cocoa/PAGFile.h | 3 +- src/platform/cocoa/PAGFont.h | 3 +- src/platform/cocoa/PAGImage.h | 3 +- src/platform/cocoa/PAGImageLayer.h | 3 +- src/platform/cocoa/PAGLayer.h | 3 +- src/platform/cocoa/PAGMarker.h | 3 +- src/platform/cocoa/PAGPlayer.h | 3 +- src/platform/cocoa/PAGShapeLayer.h | 3 +- src/platform/cocoa/PAGSolidLayer.h | 3 +- src/platform/cocoa/PAGText.h | 3 +- src/platform/cocoa/PAGTextLayer.h | 3 +- src/platform/cocoa/PAGVideoDecoder.h | 3 +- src/platform/cocoa/PAGVideoRange.h | 3 +- src/platform/ios/PAGSurface.h | 3 +- src/platform/ios/PAGView.h | 3 +- src/platform/ios/PAGView.mm | 6 ++-- src/platform/ios/private/GPUDecoder.mm | 48 ++++++++++++++++---------- src/platform/ios/private/VideoImage.mm | 7 ++-- src/platform/mac/PAGSurface.h | 3 +- src/platform/mac/PAGView.h | 3 +- 23 files changed, 75 insertions(+), 45 deletions(-) mode change 100755 => 100644 src/platform/ios/PAGView.mm diff --git a/codeformat.sh b/codeformat.sh index b058c55537..ef4b07b681 100755 --- a/codeformat.sh +++ b/codeformat.sh @@ -5,7 +5,7 @@ find tgfx/include -iname '*.h' -print0 | xargs clang-format -i # shellcheck disable=SC2038 find tgfx/src -iname "*.h" -print -o -iname "*.cpp" -print | xargs clang-format -i # shellcheck disable=SC2038 -find src -name "*.cpp" -print -o -name "*.h" -print | xargs clang-format -i +find src -name "*.cpp" -print -o -name "*.h" -print -o -name "*.mm" -print -o -name "*.m" -print | xargs clang-format -i # shellcheck disable=SC2038 find test \( -path test/framework/lzma \) -prune -o -name "*.cpp" -print -o -name "*.h" -print | xargs clang-format -i diff --git a/src/platform/cocoa/PAG.h b/src/platform/cocoa/PAG.h index 5219a3ee0c..f345420abf 100644 --- a/src/platform/cocoa/PAG.h +++ b/src/platform/cocoa/PAG.h @@ -18,7 +18,8 @@ #import -__attribute__((visibility("default"))) @interface PAG : NSObject +__attribute__((visibility("default"))) +@interface PAG : NSObject /** * Get SDK version information. */ diff --git a/src/platform/cocoa/PAGComposition.h b/src/platform/cocoa/PAGComposition.h index fa99de8d47..952275ff17 100644 --- a/src/platform/cocoa/PAGComposition.h +++ b/src/platform/cocoa/PAGComposition.h @@ -19,7 +19,8 @@ #import #import "PAGLayer.h" -__attribute__((visibility("default"))) @interface PAGComposition : PAGLayer +__attribute__((visibility("default"))) +@interface PAGComposition : PAGLayer /** * Make a empty PAGComposition with specified size. diff --git a/src/platform/cocoa/PAGFile.h b/src/platform/cocoa/PAGFile.h index 03ed963c79..96cd707a73 100644 --- a/src/platform/cocoa/PAGFile.h +++ b/src/platform/cocoa/PAGFile.h @@ -23,7 +23,8 @@ #import "PAGText.h" #import "PAGTimeStretchMode.h" -__attribute__((visibility("default"))) @interface PAGFile : PAGComposition +__attribute__((visibility("default"))) +@interface PAGFile : PAGComposition /** * The maximum tag level current SDK supports. */ diff --git a/src/platform/cocoa/PAGFont.h b/src/platform/cocoa/PAGFont.h index 663fac1c05..350c862cef 100644 --- a/src/platform/cocoa/PAGFont.h +++ b/src/platform/cocoa/PAGFont.h @@ -18,7 +18,8 @@ #import -__attribute__((visibility("default"))) @interface PAGFont : NSObject +__attribute__((visibility("default"))) +@interface PAGFont : NSObject /** * A string with the name of the font family. diff --git a/src/platform/cocoa/PAGImage.h b/src/platform/cocoa/PAGImage.h index 2dc0c53c7a..c8d9490c30 100644 --- a/src/platform/cocoa/PAGImage.h +++ b/src/platform/cocoa/PAGImage.h @@ -21,7 +21,8 @@ #import #import "PAGScaleMode.h" -__attribute__((visibility("default"))) @interface PAGImage : NSObject +__attribute__((visibility("default"))) +@interface PAGImage : NSObject /** * Creates a PAGImage object from a CGImage object, return null if it's not valid CGImage object. */ diff --git a/src/platform/cocoa/PAGImageLayer.h b/src/platform/cocoa/PAGImageLayer.h index 5ca16b1839..2bace70c35 100644 --- a/src/platform/cocoa/PAGImageLayer.h +++ b/src/platform/cocoa/PAGImageLayer.h @@ -23,7 +23,8 @@ @class PAGImage; @class PAGVideoRange; -__attribute__((visibility("default"))) @interface PAGImageLayer : PAGLayer +__attribute__((visibility("default"))) +@interface PAGImageLayer : PAGLayer /** * Make a PAGImageLayer with size and duration(in microseconds). */ diff --git a/src/platform/cocoa/PAGLayer.h b/src/platform/cocoa/PAGLayer.h index d8a37e0552..4a1b5176e2 100644 --- a/src/platform/cocoa/PAGLayer.h +++ b/src/platform/cocoa/PAGLayer.h @@ -33,7 +33,8 @@ typedef NS_ENUM(NSInteger, PAGLayerType) { @class PAGComposition; @class PAGFile; -__attribute__((visibility("default"))) @interface PAGLayer : NSObject +__attribute__((visibility("default"))) +@interface PAGLayer : NSObject /** * Returns the type of layer. diff --git a/src/platform/cocoa/PAGMarker.h b/src/platform/cocoa/PAGMarker.h index f8231f2c27..fbe3d9ff22 100644 --- a/src/platform/cocoa/PAGMarker.h +++ b/src/platform/cocoa/PAGMarker.h @@ -18,7 +18,8 @@ #import -__attribute__((visibility("default"))) @interface PAGMarker : NSObject +__attribute__((visibility("default"))) +@interface PAGMarker : NSObject @property(nonatomic) long long startTime; @property(nonatomic) long long duration; diff --git a/src/platform/cocoa/PAGPlayer.h b/src/platform/cocoa/PAGPlayer.h index e7cfa27b5b..c41ea583e2 100644 --- a/src/platform/cocoa/PAGPlayer.h +++ b/src/platform/cocoa/PAGPlayer.h @@ -23,7 +23,8 @@ #import "PAGScaleMode.h" #import "PAGSurface.h" -__attribute__((visibility("default"))) @interface PAGPlayer : NSObject +__attribute__((visibility("default"))) +@interface PAGPlayer : NSObject /** * Returns the current PAGComposition for PAGPlayer to render as content. */ diff --git a/src/platform/cocoa/PAGShapeLayer.h b/src/platform/cocoa/PAGShapeLayer.h index e6815b3200..5c03e6487e 100644 --- a/src/platform/cocoa/PAGShapeLayer.h +++ b/src/platform/cocoa/PAGShapeLayer.h @@ -19,6 +19,7 @@ #import #import "PAGLayer.h" -__attribute__((visibility("default"))) @interface PAGShapeLayer : PAGLayer +__attribute__((visibility("default"))) +@interface PAGShapeLayer : PAGLayer @end diff --git a/src/platform/cocoa/PAGSolidLayer.h b/src/platform/cocoa/PAGSolidLayer.h index 71c0f03db2..9d7d9ba896 100644 --- a/src/platform/cocoa/PAGSolidLayer.h +++ b/src/platform/cocoa/PAGSolidLayer.h @@ -20,7 +20,8 @@ #import "CocoaUtils.h" #import "PAGLayer.h" -__attribute__((visibility("default"))) @interface PAGSolidLayer : PAGLayer +__attribute__((visibility("default"))) +@interface PAGSolidLayer : PAGLayer /** * Returns the layer's solid color. diff --git a/src/platform/cocoa/PAGText.h b/src/platform/cocoa/PAGText.h index 0411d51d9c..dddefba2b4 100644 --- a/src/platform/cocoa/PAGText.h +++ b/src/platform/cocoa/PAGText.h @@ -32,7 +32,8 @@ enum { /** * The PAGText object stores a value for a TextLayer's Source Text property. */ -__attribute__((visibility("default"))) @interface PAGText : NSObject +__attribute__((visibility("default"))) +@interface PAGText : NSObject /** * When true, the text layer shows a fill. diff --git a/src/platform/cocoa/PAGTextLayer.h b/src/platform/cocoa/PAGTextLayer.h index 34f73d1836..c5f080658f 100644 --- a/src/platform/cocoa/PAGTextLayer.h +++ b/src/platform/cocoa/PAGTextLayer.h @@ -22,7 +22,8 @@ @class PAGFont; -__attribute__((visibility("default"))) @interface PAGTextLayer : PAGLayer +__attribute__((visibility("default"))) +@interface PAGTextLayer : PAGLayer /** * Returns the TextLayer’s fill color. diff --git a/src/platform/cocoa/PAGVideoDecoder.h b/src/platform/cocoa/PAGVideoDecoder.h index 586401a36a..3089eacd24 100644 --- a/src/platform/cocoa/PAGVideoDecoder.h +++ b/src/platform/cocoa/PAGVideoDecoder.h @@ -18,7 +18,8 @@ #import -__attribute__((visibility("default"))) @interface PAGVideoDecoder : NSObject +__attribute__((visibility("default"))) +@interface PAGVideoDecoder : NSObject /** * Register a software decoder factory to implement the decoder fallback mechanism. diff --git a/src/platform/cocoa/PAGVideoRange.h b/src/platform/cocoa/PAGVideoRange.h index 718adea39f..7d1049ca19 100644 --- a/src/platform/cocoa/PAGVideoRange.h +++ b/src/platform/cocoa/PAGVideoRange.h @@ -21,7 +21,8 @@ /** * Represents a time range from the content of PAGImageLayer. */ -__attribute__((visibility("default"))) @interface PAGVideoRange : NSObject +__attribute__((visibility("default"))) +@interface PAGVideoRange : NSObject /** * The start time of the source video, in microseconds. diff --git a/src/platform/ios/PAGSurface.h b/src/platform/ios/PAGSurface.h index 8a26bb60e1..1e6c6674a8 100644 --- a/src/platform/ios/PAGSurface.h +++ b/src/platform/ios/PAGSurface.h @@ -22,7 +22,8 @@ #import #import "PAGImageLayer.h" -__attribute__((visibility("default"))) @interface PAGSurface : NSObject +__attribute__((visibility("default"))) +@interface PAGSurface : NSObject /** * Creates a new PAGSurface from specified CAEAGLLayer. The GPU context will be created internally diff --git a/src/platform/ios/PAGView.h b/src/platform/ios/PAGView.h index ef707a52c4..62578995c4 100644 --- a/src/platform/ios/PAGView.h +++ b/src/platform/ios/PAGView.h @@ -66,7 +66,8 @@ @end -__attribute__((visibility("default"))) @interface PAGView : UIView +__attribute__((visibility("default"))) +@interface PAGView : UIView /** * Default is NO. diff --git a/src/platform/ios/PAGView.mm b/src/platform/ios/PAGView.mm old mode 100755 new mode 100644 index 0769b274e7..f5edace11f --- a/src/platform/ios/PAGView.mm +++ b/src/platform/ios/PAGView.mm @@ -64,9 +64,9 @@ + (NSOperationQueue*)FlushQueue { return pag::flushQueue; } -/// 函数用于在执行 exit() 函数时把渲染任务全部完成,防止 PAG 的全局函数被析构,导致 PAG 野指针 crash。 -/// 注意这里注册需要等待 PAG 执行一次后再进行注册。因此需要等到 bufferPerpared 并再执行一次 flush 后, -/// 否则 PAG 的 static 对象仍然会先析构 +/// 函数用于在执行 exit() 函数时把渲染任务全部完成,防止 PAG 的全局函数被析构,导致 PAG 野指针 +/// crash。 注意这里注册需要等待 PAG 执行一次后再进行注册。因此需要等到 bufferPerpared 并再执行一次 +/// flush 后, 否则 PAG 的 static 对象仍然会先析构 + (void)RegisterFlushQueueDestoryMethod { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ diff --git a/src/platform/ios/private/GPUDecoder.mm b/src/platform/ios/private/GPUDecoder.mm index 80384fd8b0..d4f131f27e 100644 --- a/src/platform/ios/private/GPUDecoder.mm +++ b/src/platform/ios/private/GPUDecoder.mm @@ -24,9 +24,10 @@ namespace pag { -GPUDecoder::GPUDecoder(const VideoConfig& config) : sourceColorSpace(config.colorSpace), - destinationColorSpace(config.colorSpace), - colorRange(config.colorRange) { +GPUDecoder::GPUDecoder(const VideoConfig& config) + : sourceColorSpace(config.colorSpace), + destinationColorSpace(config.colorSpace), + colorRange(config.colorRange) { isInitialized = initVideoToolBox(config.headers, config.mimeType); } @@ -147,11 +148,11 @@ void initParameterSets(const std::vector>& headers, CFDictionaryRef attrs = NULL; const void* keys[] = {kCVPixelBufferPixelFormatTypeKey, kCVPixelBufferOpenGLESCompatibilityKey, kCVPixelBufferIOSurfacePropertiesKey}; - + uint32_t openGLESCompatibility = true; - uint32_t pixelFormatType = - colorRange == YUVColorRange::JPEG ? kCVPixelFormatType_420YpCbCr8BiPlanarFullRange - : kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; + uint32_t pixelFormatType = colorRange == YUVColorRange::JPEG + ? kCVPixelFormatType_420YpCbCr8BiPlanarFullRange + : kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; CFNumberRef pixelFormatTypeValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &pixelFormatType); CFNumberRef openGLESCompatibilityValue = @@ -178,18 +179,25 @@ void initParameterSets(const std::vector>& headers, if (@available(iOS 10.0, *)) { if (sourceColorSpace == YUVColorSpace::Rec2020) { - CFStringRef destinationColorPrimaries = CFStringCreateWithCString(kCFAllocatorDefault, "DestinationColorPrimaries", kCFStringEncodingUTF8); - CFStringRef destinationTransferFunction = CFStringCreateWithCString(kCFAllocatorDefault, "DestinationTransferFunction", kCFStringEncodingUTF8); - CFStringRef destinationYCbCrMatrix = CFStringCreateWithCString(kCFAllocatorDefault, "DestinationYCbCrMatrix", kCFStringEncodingUTF8); - CFStringRef pixelTransferProperties = CFStringCreateWithCString(kCFAllocatorDefault, "PixelTransferProperties", kCFStringEncodingUTF8); - - CFMutableDictionaryRef pixelTransferPropertiesParam = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, - &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - CFDictionarySetValue(pixelTransferPropertiesParam, destinationColorPrimaries, kCVImageBufferColorPrimaries_ITU_R_709_2); - CFDictionarySetValue(pixelTransferPropertiesParam, destinationTransferFunction, kCVImageBufferTransferFunction_ITU_R_709_2); - CFDictionarySetValue(pixelTransferPropertiesParam, destinationYCbCrMatrix, kCVImageBufferYCbCrMatrix_ITU_R_709_2); + CFStringRef destinationColorPrimaries = CFStringCreateWithCString( + kCFAllocatorDefault, "DestinationColorPrimaries", kCFStringEncodingUTF8); + CFStringRef destinationTransferFunction = CFStringCreateWithCString( + kCFAllocatorDefault, "DestinationTransferFunction", kCFStringEncodingUTF8); + CFStringRef destinationYCbCrMatrix = CFStringCreateWithCString( + kCFAllocatorDefault, "DestinationYCbCrMatrix", kCFStringEncodingUTF8); + CFStringRef pixelTransferProperties = CFStringCreateWithCString( + kCFAllocatorDefault, "PixelTransferProperties", kCFStringEncodingUTF8); + + CFMutableDictionaryRef pixelTransferPropertiesParam = CFDictionaryCreateMutable( + kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + CFDictionarySetValue(pixelTransferPropertiesParam, destinationColorPrimaries, + kCVImageBufferColorPrimaries_ITU_R_709_2); + CFDictionarySetValue(pixelTransferPropertiesParam, destinationTransferFunction, + kCVImageBufferTransferFunction_ITU_R_709_2); + CFDictionarySetValue(pixelTransferPropertiesParam, destinationYCbCrMatrix, + kCVImageBufferYCbCrMatrix_ITU_R_709_2); VTSessionSetProperty(session, pixelTransferProperties, pixelTransferPropertiesParam); - + CFRelease(destinationColorPrimaries); CFRelease(destinationTransferFunction); CFRelease(destinationYCbCrMatrix); @@ -264,7 +272,9 @@ void initParameterSets(const std::vector>& headers, if (status == kVTInvalidSessionErr) { cleanResources(); isInitialized = resetVideoToolBox(); - LOGI("GPUDecoder: Resetting VideoToolBox session, which may be caused by app entered background, initialized = %d", isInitialized); + LOGI("GPUDecoder: Resetting VideoToolBox session, which may be caused by app entered " + "background, initialized = %d", + isInitialized); } else { LOGE("GPUDecoder:Decode failed status = %d", (int)status); } diff --git a/src/platform/ios/private/VideoImage.mm b/src/platform/ios/private/VideoImage.mm index e6f7e15fd7..a1b38efa02 100644 --- a/src/platform/ios/private/VideoImage.mm +++ b/src/platform/ios/private/VideoImage.mm @@ -44,13 +44,14 @@ } videoImageMap.erase(result); } - auto videoImage = std::shared_ptr(new VideoImage(pixelBuffer, colorSpace, colorRange)); + auto videoImage = + std::shared_ptr(new VideoImage(pixelBuffer, colorSpace, colorRange)); videoImageMap[pixelBuffer] = videoImage; return videoImage; } -VideoImage::VideoImage(CVPixelBufferRef pixelBuffer, - YUVColorSpace colorSpace, YUVColorRange colorRange) +VideoImage::VideoImage(CVPixelBufferRef pixelBuffer, YUVColorSpace colorSpace, + YUVColorRange colorRange) : VideoBuffer(static_cast(CVPixelBufferGetWidth(pixelBuffer)), static_cast(CVPixelBufferGetHeight(pixelBuffer))), pixelBuffer(pixelBuffer), diff --git a/src/platform/mac/PAGSurface.h b/src/platform/mac/PAGSurface.h index 45d388ada6..32a70af18d 100644 --- a/src/platform/mac/PAGSurface.h +++ b/src/platform/mac/PAGSurface.h @@ -23,7 +23,8 @@ #import #import "PAGImageLayer.h" -__attribute__((visibility("default"))) @interface PAGSurface : NSObject +__attribute__((visibility("default"))) +@interface PAGSurface : NSObject + (PAGSurface*)FromView:(NSView*)view; diff --git a/src/platform/mac/PAGView.h b/src/platform/mac/PAGView.h index 5af4b962a2..c15a5ee534 100644 --- a/src/platform/mac/PAGView.h +++ b/src/platform/mac/PAGView.h @@ -66,7 +66,8 @@ @end -__attribute__((visibility("default"))) @interface PAGView : NSView +__attribute__((visibility("default"))) +@interface PAGView : NSView /** * Adds a listener to the set of listeners that are sent events through the life of an animation,