Enable ClangTidy check llvm-namespace-comment.

This fixes a large number of SkSL namespaces which were labeled as if
they were anonymous, and also a handful of other mislabeled namespaces.
Missing namespace-end comments have been added throughout.
A number of diffs are just indentation-related (adjusting 1- or 3-
space indents to 2-space).

Change-Id: I6c62052a0d3aea4ae12ca07e0c2a8587b2fce4ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308503
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2020-08-06 14:11:56 -04:00 committed by Skia Commit-Bot
parent 269b21c501
commit a6841be235
424 changed files with 460 additions and 457 deletions

View File

@ -1 +1,4 @@
Checks: '-*,bugprone-use-after-move,bugprone-unused-raii,bugprone-undelegated-constructor,bugprone-argument-comment,performance-for-range-copy,bugprone-bool-pointer-implicit-conversion,readability-redundant-preprocessor,misc-definitions-in-headers,modernize-make-unique,google-build-namespaces'
Checks: '-*,bugprone-use-after-move,bugprone-unused-raii,bugprone-undelegated-constructor,bugprone-argument-comment,performance-for-range-copy,bugprone-bool-pointer-implicit-conversion,readability-redundant-preprocessor,misc-definitions-in-headers,modernize-make-unique,llvm-namespace-comment,google-build-namespaces'
CheckOptions:
- key: llvm-namespace-comment.SpacesBeforeComments
value: 2

View File

@ -18,8 +18,8 @@
namespace android {
namespace skia {
class BitmapRegionDecoder;
}
}
} // namespace skia
} // namespace android
/**
* Benchmark Android's BitmapRegionDecoder for a particular colorType, sampleSize, and subset.

View File

@ -25,7 +25,7 @@ struct Rec {
const SkUnichar* fText;
int fCount;
};
}
} // namespace
typedef void (*TypefaceProc)(const Rec& r);

View File

@ -32,7 +32,7 @@ static_assert(GrAlignTo(sizeof(Unaligned), GrMemoryPool::kAlignment) == sizeof(A
// of operations, the size of the objects being allocated, and the size of the pool.
typedef void (*RunBenchProc)(GrMemoryPool*, int);
}
} // namespace
// N objects are created, and then destroyed in reverse order (fully unwinding the cursor within
// each block of the memory pool).

View File

@ -33,7 +33,7 @@ struct TestRec : public SkResourceCache::Rec {
return true;
}
};
}
} // namespace
class ImageCacheBench : public Benchmark {
SkResourceCache fCache;

View File

@ -15,7 +15,7 @@ namespace {
enum Mode {Opts, RP, F32, I32_Naive};
static const char* kMode_name[] = { "Opts", "RP","F32", "I32_Naive" };
}
} // namespace
class SkVMBench : public Benchmark {
public:

View File

@ -275,7 +275,7 @@ private:
typedef GrMeshDrawOp INHERITED;
};
}
} // namespace
class VertexColorSpaceBench : public Benchmark {
public:

View File

@ -25,8 +25,8 @@
namespace skiagm {
namespace verifiers {
class VerifierList;
}
}
} // namespace verifiers
} // namespace skiagm
namespace DM {

View File

@ -315,6 +315,6 @@ private:
std::vector<sk_sp<Artboard>> fArtboards;
};
} // skrive
} // namespace skrive
#endif // SkRive_DEFINED

View File

@ -44,7 +44,7 @@ size_t parse_node<Node>(StreamReader* sr, Node* node) {
return parent_id;
}
} // namespace skrive
} // namespace internal
void Node::addChild(sk_sp<Component> child) {
child->fParent = this;
@ -74,4 +74,4 @@ void Node::onRender(SkCanvas* canvas) const {
}
} // namespace internal
} // namespace skrive

View File

@ -150,4 +150,4 @@ std::unique_ptr<StreamReader> MakeBinaryStreamReader(std::unique_ptr<SkStreamAss
return std::make_unique<BinaryReader>(std::move(stream));
}
}
} // namespace skrive::internal

View File

@ -103,6 +103,6 @@ protected:
virtual size_t readFloatArray(const char label[], float dst[], size_t count) = 0;
};
}
} // namespace skrive::internal
#endif // SkRiveStreamreader_DEFINED

View File

@ -239,6 +239,6 @@ struct LIT<C, Cs...> {
}
};
} // skpeg ns
} // namespace skpeg
#endif // SkPEG_DEFINED

View File

@ -30,7 +30,7 @@ inline bool is_sep(char c) {
return is_ws(c) || c == ',' || c == ';';
}
} // anonymous ns
} // namespace
SkSVGAttributeParser::SkSVGAttributeParser(const char attributeString[])
: fCurPos(attributeString) {}

View File

@ -38,7 +38,7 @@ constexpr SkScalar kPCMultiplier = kPTMultiplier * 12;
constexpr SkScalar kMMMultiplier = kINMultiplier / 25.4f;
constexpr SkScalar kCMMultiplier = kMMMultiplier * 10;
} // anonymous ns
} // namespace
SkScalar SkSVGLengthContext::resolve(const SkSVGLength& l, LengthType t) const {
switch (l.unit()) {
@ -274,7 +274,7 @@ void commitToPaint<SkSVGAttribute::kColor>(const SkSVGPresentationAttributes&,
// Not part of the SkPaint state; applied via 'currentColor' color value
}
} // anonymous ns
} // namespace
SkSVGPresentationContext::SkSVGPresentationContext()
: fInherited(SkSVGPresentationAttributes::MakeInitial()) {

View File

@ -133,4 +133,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new AndroidBlendModesGM;)
}
} // namespace skiagm

View File

@ -121,4 +121,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new AnisotropicGM;)
}
} // namespace skiagm

View File

@ -87,4 +87,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ArcOfZorroGM;)
}
} // namespace skiagm

View File

@ -216,4 +216,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new BC1TransparencyGM;)
}
} // namespace skiagm

View File

@ -502,4 +502,4 @@ private:
DEF_GM(return new BezierConicEffects;)
DEF_GM(return new BezierQuadEffects;)
}
} // namespace skiagm

View File

@ -121,4 +121,4 @@ private:
};
DEF_GM(return new BigBlursGM;)
}
} // namespace skiagm

View File

@ -141,4 +141,4 @@ DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize -
DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 10.f), "circular_corner"); )
DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 15.f), "elliptical_corner"); )
}
} // namespace skiagm

View File

@ -118,4 +118,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new BigTileImageFilterGM;)
}
} // namespace skiagm

View File

@ -86,4 +86,4 @@ private:
DEF_GM( return new BitmapImageGM; )
}
} // namespace skiagm

View File

@ -115,4 +115,4 @@ private:
};
DEF_GM( return new BitmapPremulGM; )
}
} // namespace skiagm

View File

@ -146,4 +146,4 @@ DEF_SIMPLE_GM(hugebitmapshader, canvas, 100, 100) {
DEF_GM( return new BitmapShaderGM; )
}
} // namespace skiagm

View File

@ -96,4 +96,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new BlurredClippedCircleGM;)
}
} // namespace skiagm

View File

@ -211,4 +211,4 @@ private:
DEF_GM( return new CircleGM; )
}
} // namespace skiagm

View File

@ -299,4 +299,4 @@ void ClockwiseGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc, Sk
DEF_GM( return new ClockwiseGM(); )
}
} // namespace

View File

@ -141,7 +141,7 @@ void test_collapse10(SkCanvas* canvas, const SkPaint& paint) {
canvas->drawPath(path.detach(), paint);
}
};
} // namespace
DEF_SIMPLE_GM(collapsepaths, canvas, 500, 600) {
SkPaint paint;

View File

@ -198,4 +198,4 @@ protected:
DEF_GM(return new ColorEmojiGM;)
}
} // namespace skiagm

View File

@ -207,7 +207,7 @@ DEF_GM(return new ComplexClipGM(true, false, false);)
DEF_GM(return new ComplexClipGM(true, false, true);)
DEF_GM(return new ComplexClipGM(true, true, false);)
DEF_GM(return new ComplexClipGM(true, true, true);)
}
} // namespace skiagm
DEF_SIMPLE_GM(clip_shader, canvas, 840, 650) {
auto img = GetResourceAsImage("images/yellow_rose.png");
@ -343,7 +343,7 @@ static void draw_banner(SkCanvas* canvas, Config config) {
canvas->drawString(banner.c_str(), 20.f, -30.f, kFont, SkPaint());
};
} // anonymous
} // namespace
DEF_SIMPLE_GM(clip_shader_persp, canvas, 1370, 1030) {
// Each draw has a clipShader(image-shader), a clipShader(gradient-shader), a concat(persp-mat),

View File

@ -224,4 +224,4 @@ DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRect_Clip, true); )
DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kRRect_Clip, true); )
DEF_GM( return new ComplexClip2GM(ComplexClip2GM::kPath_Clip, true); )
}
} // namespace skiagm

View File

@ -138,4 +138,4 @@ private:
DEF_GM( return new ComplexClip3GM(true); )
// Complex clip first
DEF_GM( return new ComplexClip3GM(false); )
}
} // namespace skiagm

View File

@ -134,4 +134,4 @@ private:
DEF_GM(return new ComplexClip4GM(false);)
DEF_GM(return new ComplexClip4GM(true);)
}
} // namespace skiagm

View File

@ -75,4 +75,4 @@ private:
DEF_GM(return new ComplexClipBlurTiledGM;)
}
} // namespace skiagm

View File

@ -361,7 +361,7 @@ void test_coincident_edges_4(SkCanvas* canvas, const SkPaint& paint) {
canvas->restore();
}
};
} // namespace
DEF_SIMPLE_GM(concavepaths, canvas, 500, 600) {
SkPaint paint;

View File

@ -220,4 +220,4 @@ DEF_GM(return new ColorProcessor{ColorProcessor::TestMode::kConstColor};)
DEF_GM(return new ColorProcessor{ColorProcessor::TestMode::kModulateRGBA};)
DEF_GM(return new ColorProcessor{ColorProcessor::TestMode::kModulateAlpha};)
}
} // namespace skiagm

View File

@ -161,7 +161,7 @@ const size_t gSizes[] = {
SK_ARRAY_COUNT(gPoints10),
};
static_assert(SK_ARRAY_COUNT(gSizes) == SK_ARRAY_COUNT(gPoints), "array_mismatch");
}
} // namespace ConvexLineOnlyData
namespace skiagm {
@ -412,4 +412,4 @@ private:
DEF_GM(return new ConvexLineOnlyPathsGM(false);)
DEF_GM(return new ConvexLineOnlyPathsGM(true);)
}
} // namespace skiagm

View File

@ -313,4 +313,4 @@ private:
};
DEF_GM(return new ConvexPolyClip;)
}
} // namespace skiagm

View File

@ -206,4 +206,4 @@ private:
};
DEF_GM(return new ConvexPolyEffect;)
}
} // namespace skiagm

View File

@ -115,4 +115,4 @@ private:
DEF_GM( return new CroppedRectsGM(); )
}
} // namespace skiagm

View File

@ -370,4 +370,4 @@ class DegenerateSegmentsGM : public GM {
DEF_GM( return new DegenerateSegmentsGM; )
}
} // namespace skiagm

View File

@ -99,4 +99,4 @@ private:
DEF_GM(return new DiscardGM;)
} // end namespace
} // namespace skiagm

View File

@ -171,4 +171,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new DisplacementMapGM;)
}
} // namespace skiagm

View File

@ -65,4 +65,4 @@ class DistantClipGM : public GM {
DEF_GM( return new DistantClipGM; )
}
} // namespace skiagm

View File

@ -200,4 +200,4 @@ private:
DEF_GM( return new DstReadShuffle; )
}
} // namespace skiagm

View File

@ -185,4 +185,4 @@ class EmptyStrokeGM : public GM {
};
DEF_GM( return new EmptyStrokeGM; )
}
} // namespace skiagm

View File

@ -55,7 +55,7 @@ private:
};
DEF_GM( return new EncodeGM; )
}
} // namespace skiagm
///////////

View File

@ -108,4 +108,4 @@ private:
DEF_GM( return new EncodeJpegAlphaOptsGM; )
};
} // namespace skiagm

View File

@ -167,4 +167,4 @@ private:
DEF_VARIANTS(SkEncodedImageFormat::kWEBP, 100, "webp-lossless")
DEF_VARIANTS(SkEncodedImageFormat::kWEBP, 80, "webp-lossy")
}
} // namespace skiagm

View File

@ -131,4 +131,4 @@ private:
};
DEF_GM( return new EncodePlatformGM; )
}
} // namespace skiagm

View File

@ -150,4 +150,4 @@ private:
DEF_GM( return new EncodeSRGBGM(SkEncodedImageFormat::kPNG); )
DEF_GM( return new EncodeSRGBGM(SkEncodedImageFormat::kWEBP); )
DEF_GM( return new EncodeSRGBGM(SkEncodedImageFormat::kJPEG); )
}
} // namespace skiagm

View File

@ -440,4 +440,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ExoticFormatsGM;)
}
} // namespace skiagm

View File

@ -84,4 +84,4 @@ private:
DEF_GM( return new ExtractBitmapGM; )
}
} // namespace skiagm

View File

@ -99,4 +99,4 @@ private:
DEF_GM( return new FillTypeGM; )
}
} // namespace skiagm

View File

@ -139,4 +139,4 @@ private:
DEF_GM( return new FillTypePerspGM; )
}
} // namespace skiagm

View File

@ -325,4 +325,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ImageFilterFastBoundGM;)
}
} // namespace skiagm

View File

@ -85,4 +85,4 @@ private:
DEF_GM( return new FontScalerGM; )
}
} // namespace skiagm

View File

@ -140,4 +140,4 @@ private:
DEF_GM( return new FontScalerDistortableGM; )
}
} // namespace skiagm

View File

@ -263,4 +263,4 @@ DEF_SIMPLE_GPU_GM_CAN_FAIL(fwidth_squircle, ctx, rtc, canvas, errorMsg, 200, 200
return skiagm::DrawResult::kOk;
}
}
} // namespace skiagm

View File

@ -251,7 +251,7 @@ namespace skiagm {
const SkISize fSize;
const DrawProc fDrawProc;
};
}
} // namespace skiagm
void MarkGMGood(SkCanvas*, SkScalar x, SkScalar y);
void MarkGMBad (SkCanvas*, SkScalar x, SkScalar y);

View File

@ -407,4 +407,4 @@ DEF_GM( return new ConicalGradientsGM(kInside_GradCaseType, false); )
DEF_GM( return new ConicalGradientsGM(kOutside_GradCaseType, false); )
DEF_GM( return new ConicalGradientsGM(kEdge_GradCaseType, false); )
}
} // namespace skiagm

View File

@ -299,4 +299,4 @@ DEF_SIMPLE_GM(hairline_subdiv, canvas, 512, 256) {
DEF_GM( return new HairlinesGM; )
}
} // namespace skiagm

View File

@ -132,4 +132,4 @@ namespace skiagm {
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return new HairModesGM; )
}
} // namespace skiagm

View File

@ -111,4 +111,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ImageBlurClampModeGM;)
}
} // namespace skiagm

View File

@ -125,7 +125,7 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ImageBlurRepeatModeGM;)
}
} // namespace skiagm
// See skbug.com/10145 for more context, but if the blur doesn't have its own crop rect and
// the canvas is not clipped, repeat can behave strangely (before fixes, this meant:

View File

@ -78,4 +78,4 @@ private:
DEF_GM(return new ImageBlurTiledGM(3.0f, 3.0f);)
}
} // namespace skiagm

View File

@ -85,7 +85,7 @@ namespace {
SK_REGISTER_FLATTENABLE(FailImageFilter);
}
} initializer;
}
} // namespace
sk_sp<SkFlattenable> IdentityImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);

View File

@ -156,4 +156,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ImageFiltersClippedGM;)
}
} // namespace skiagm

View File

@ -33,7 +33,7 @@ sk_sp<SkImage> make_gradient_circle(int width, int height);
void draw(SkCanvas* canvas, const SkBitmap& bitmap, const SkIRect& rect,
sk_sp<SkImageFilter> filter);
};
} // namespace
///////////////////////////////////////////////////////////////////////////////
@ -163,4 +163,4 @@ namespace {
canvas->translate(SkIntToScalar(80), 0);
}
};
} // namespace

View File

@ -162,4 +162,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ImageFiltersScaledGM;)
}
} // namespace skiagm

View File

@ -109,4 +109,4 @@ private:
DEF_GM(return new ImageFiltersStrokedGM;)
}
} // namespace skiagm

View File

@ -123,7 +123,7 @@ private:
typedef GM INHERITED;
};
DEF_GM( return new ImageFiltersTransformedGM; )
}
} // namespace skiagm
//////////////////////////////////////////////////////////////////////////////

View File

@ -335,4 +335,4 @@ private:
};
DEF_GM(return new ImageFromYUVTextures;)
}
} // namespace skiagm

View File

@ -178,7 +178,7 @@ namespace {
// Uses saveLayer after clipRect() to filter on the restore (i.e. reference image)
kSaveLayer
};
};
} // namespace
// In this GM, we're going to feed the inner portion of a 100x100 mandrill (i.e., strip off a
// 25-wide border) through the makeWithFilter method. We'll then draw the appropriate subset of the

View File

@ -70,7 +70,7 @@ const MakerT makers[] = {
},
};
} // anonymous ns
} // namespace
// Checks whether subset SkImages preserve the original color type (A8 in this case).
DEF_SIMPLE_GM(imagemasksubset, canvas, 480, 480) {

View File

@ -99,4 +99,4 @@ DEF_GM(return new ImageSourceGM("none", kNone_SkFilterQuality);)
DEF_GM(return new ImageSourceGM("low", kLow_SkFilterQuality);)
DEF_GM(return new ImageSourceGM("med", kMedium_SkFilterQuality);)
DEF_GM(return new ImageSourceGM("high", kHigh_SkFilterQuality);)
}
} // namespace skiagm

View File

@ -69,4 +69,4 @@ private:
};
DEF_GM( return new ColorCubeGM; )
}
} // namespace skiagm

View File

@ -152,4 +152,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return new LcdBlendGM; )
}
} // namespace skiagm

View File

@ -97,4 +97,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return new LcdOverlapGM; )
}
} // namespace skiagm

View File

@ -153,4 +153,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new ImageLightingGM;)
}
} // namespace skiagm

View File

@ -198,4 +198,4 @@ protected:
DEF_GM(return new SliverPathsGM;)
}
} // namespace skiagm

View File

@ -125,4 +125,4 @@ private:
DEF_GM( return new ManyCirclesGM; )
DEF_GM( return new ManyRRectsGM; )
}
} // namespace skiagm

View File

@ -150,4 +150,4 @@ DEF_GM(return new MatrixConvolutionGM(0xFFFF0000, 0xFF00FF00, KernelFixture::kBa
DEF_GM(return new MatrixConvolutionGM(0xFFFFFFFF, 0x40404040, KernelFixture::kLarge_KernelFixture, "_big");)
DEF_GM(return new MatrixConvolutionGM(0xFFFF0000, 0xFF00FF00, KernelFixture::kLarge_KernelFixture, "_big_color");)
}
} // namespace skiagm

View File

@ -166,4 +166,4 @@ private:
//////////////////////////////////////////////////////////////////////////////
DEF_GM(return new MixedTextBlobsGM;)
}
} // namespace skiagm

View File

@ -169,4 +169,4 @@ private:
DEF_GM( return new ModeColorFilterGM; )
}
} // namespace skiagm

View File

@ -100,4 +100,4 @@ private:
DEF_GM(return new MorphologyGM;)
}
} // namespace skiagm

View File

@ -147,4 +147,4 @@ DEF_GM( return new NestedGM(/* doAA = */ false, /* flipped = */ false); )
DEF_GM( return new NestedGM(/* doAA = */ true, /* flipped = */ true); )
DEF_GM( return new NestedGM(/* doAA = */ false, /* flipped = */ true); )
}
} // namespace skiagm

View File

@ -148,4 +148,4 @@ private:
DEF_GM(return new NonClosedPathsGM;)
}
} // namespace skiagm

View File

@ -308,4 +308,4 @@ private:
DEF_GM( return new OvalGM; )
}
} // namespace skiagm

View File

@ -176,7 +176,7 @@ private:
DEF_GM( return new PathEffectGM; )
}
} // namespace skiagm
//////////////////////////////////////////////////////////////////////////////

View File

@ -117,7 +117,7 @@ private:
DEF_GM( return new PathOpsInverseGM; )
}
} // namespace skiagm
#include "include/pathops/SkPathOps.h"
#include "include/utils/SkParsePath.h"

View File

@ -181,7 +181,7 @@ private:
};
DEF_GM(return new PerspShadersGM(true);)
DEF_GM(return new PerspShadersGM(false);)
}
} // namespace skiagm
//////////////////////////////////////////////////////////////////////////////

View File

@ -79,4 +79,4 @@ private:
DEF_GM( return new PointsGM; )
}
} // namespace skiagm

View File

@ -413,7 +413,7 @@ const size_t gSimpleSizes[] = {
};
static_assert(SK_ARRAY_COUNT(gSimpleSizes) == SK_ARRAY_COUNT(gSimplePoints), "array_mismatch");
}
} // namespace PolygonOffsetData
namespace skiagm {
@ -623,4 +623,4 @@ private:
DEF_GM(return new PolygonOffsetGM(true);)
DEF_GM(return new PolygonOffsetGM(false);)
}
} // namespace skiagm

View File

@ -172,4 +172,4 @@ private:
DEF_GM(return new PolygonsGM;)
}
} // namespace skiagm

View File

@ -151,4 +151,4 @@ private:
DEF_GM( return new PreserveFillRuleGM(true); )
DEF_GM( return new PreserveFillRuleGM(false); )
}
} // namespace skiagm

View File

@ -288,4 +288,4 @@ DEF_GM( return new QuadPathGM; )
DEF_GM( return new QuadClosePathGM; )
}
} // namespace skiagm

View File

@ -261,5 +261,5 @@ private:
};
DEF_GM(return new RectangleTexture;)
}
} // namespace skiagm
#endif

Some files were not shown because too many files have changed in this diff Show More