remove Sk prefix from CommandLineFlags
The command line flag package is tool-only, not part of Skia per se,
and does not need an Sk prefix to avoid naming conflicts.
And git clang-format.
Change-Id: Ida8477779e51750ed0475590ed2454841b23d6ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 0e82bd1..43ec1b9 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -5,7 +5,11 @@
* found in the LICENSE file.
*/
+#include "Viewer.h"
#include "BisectSlide.h"
+#include "CommandLineFlags.h"
+#include "CommonFlags.h"
+#include "CommonFlagsGpu.h"
#include "GMSlide.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -16,9 +20,6 @@
#include "SampleSlide.h"
#include "SkCanvas.h"
#include "SkColorSpacePriv.h"
-#include "SkCommandLineFlags.h"
-#include "SkCommonFlags.h"
-#include "SkCommonFlagsGpu.h"
#include "SkEventTracingPriv.h"
#include "SkFontMgrPriv.h"
#include "SkGraphics.h"
@@ -37,7 +38,6 @@
#include "SkTo.h"
#include "SlideDir.h"
#include "SvgSlide.h"
-#include "Viewer.h"
#include "ccpr/GrCoverageCountingPathRenderer.h"
#include <stdlib.h>
@@ -233,7 +233,7 @@
}
SkDebugf("\n");
- SkCommandLineFlags::Parse(argc, argv);
+ CommandLineFlags::Parse(argc, argv);
#ifdef SK_BUILD_FOR_ANDROID
SetResourcePath("/data/local/tmp/resources");
#endif
@@ -549,7 +549,7 @@
static const struct {
const char* fExtension;
const char* fDirName;
- const SkCommandLineFlags::StringArray& fFlags;
+ const CommandLineFlags::StringArray& fFlags;
const SlideFactory fFactory;
} gExternalSlidesInfo[] = {
{ ".skp", "skp-dir", FLAGS_skps,
@@ -582,18 +582,17 @@
SkTArray<sk_sp<Slide>> dirSlides;
- const auto addSlide = [&](const SkString& name,
- const SkString& path,
- const SlideFactory& fact) {
- if (SkCommandLineFlags::ShouldSkip(FLAGS_match, name.c_str())) {
- return;
- }
+ const auto addSlide =
+ [&](const SkString& name, const SkString& path, const SlideFactory& fact) {
+ if (CommandLineFlags::ShouldSkip(FLAGS_match, name.c_str())) {
+ return;
+ }
- if (auto slide = fact(name, path)) {
- dirSlides.push_back(slide);
- fSlides.push_back(std::move(slide));
- }
- };
+ if (auto slide = fact(name, path)) {
+ dirSlides.push_back(slide);
+ fSlides.push_back(std::move(slide));
+ }
+ };
if (!FLAGS_file.isEmpty()) {
// single file mode
@@ -618,7 +617,7 @@
// Bisect slide.
if (!FLAGS_bisect.isEmpty()) {
sk_sp<BisectSlide> bisect = BisectSlide::Create(FLAGS_bisect[0]);
- if (bisect && !SkCommandLineFlags::ShouldSkip(FLAGS_match, bisect->getName().c_str())) {
+ if (bisect && !CommandLineFlags::ShouldSkip(FLAGS_match, bisect->getName().c_str())) {
if (FLAGS_bisect.count() >= 2) {
for (const char* ch = FLAGS_bisect[1]; *ch; ++ch) {
bisect->onChar(*ch);
@@ -632,7 +631,7 @@
int firstGM = fSlides.count();
for (skiagm::GMFactory gmFactory : skiagm::GMRegistry::Range()) {
std::unique_ptr<skiagm::GM> gm(gmFactory(nullptr));
- if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, gm->getName())) {
+ if (!CommandLineFlags::ShouldSkip(FLAGS_match, gm->getName())) {
sk_sp<Slide> slide(new GMSlide(gm.release()));
fSlides.push_back(std::move(slide));
}
@@ -646,7 +645,7 @@
// samples
for (const SampleFactory factory : SampleRegistry::Range()) {
sk_sp<Slide> slide(new SampleSlide(factory));
- if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, slide->getName().c_str())) {
+ if (!CommandLineFlags::ShouldSkip(FLAGS_match, slide->getName().c_str())) {
fSlides.push_back(slide);
}
}
@@ -655,7 +654,7 @@
{
// TODO: Convert this to a sample
sk_sp<Slide> slide(new ParticlesSlide());
- if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, slide->getName().c_str())) {
+ if (!CommandLineFlags::ShouldSkip(FLAGS_match, slide->getName().c_str())) {
fSlides.push_back(std::move(slide));
}
}