skia2/tools/list_gms.cpp
Hal Canary edda5653e1 gm: GMFactory returns a unique_ptr<>
Change-Id: If8a4d3cfdeaef58dd9924af430cfed834519b096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232496
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-12 19:02:40 +00:00

26 lines
586 B
C++

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include "gm/gm.h"
int main() {
std::vector<std::string> gms;
for (skiagm::GMFactory factory : skiagm::GMRegistry::Range()) {
std::unique_ptr<skiagm::GM> gm(factory());
gms.push_back(std::string(gm->getName()));
}
std::sort(gms.begin(), gms.end());
for (const std::string& gm : gms) {
std::cout << gm << '\n';
}
}