Remove custom SkSort algorithms.

SortBench shows that SkTQSort and SkTHeapSort are inferior to std::sort.
The difference is small on randomized inputs, but quite significant for
semi-ordered inputs (forward/backward/repeated). There doesn't seem to
to be any compelling advantage to SkTQSort.

Nanobench results: https://screenshot.googleplex.com/9JOLV1d6Z0u

(These performance numbers are from an optimized build my local machine;
it's possible that we might see different results on the test bots.)

Change-Id: Iaf19563041547eae7de2953be249129108f093b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302295
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/tools/skdiff/skdiff_main.cpp b/tools/skdiff/skdiff_main.cpp
index df6e2a1..eec6306 100644
--- a/tools/skdiff/skdiff_main.cpp
+++ b/tools/skdiff/skdiff_main.cpp
@@ -318,9 +318,9 @@
     files->deleteAll();
 }
 
-/// Comparison routines for qsort, sort by file names.
-static int compare_file_name_metrics(SkString **lhs, SkString **rhs) {
-    return strcmp((*lhs)->c_str(), (*rhs)->c_str());
+/// Comparison routine for sorting by file name.
+static int compare_file_name_metrics(const SkString* lhs, const SkString* rhs) {
+    return strcmp(lhs->c_str(), rhs->c_str()) < 0;
 }
 
 class AutoReleasePixels {
@@ -397,12 +397,10 @@
                   &comparisonFiles);
 
     if (!baseFiles.isEmpty()) {
-        qsort(baseFiles.begin(), baseFiles.count(), sizeof(SkString*),
-              SkCastForQSort(compare_file_name_metrics));
+        std::sort(baseFiles.begin(), baseFiles.end(), compare_file_name_metrics);
     }
     if (!comparisonFiles.isEmpty()) {
-        qsort(comparisonFiles.begin(), comparisonFiles.count(),
-              sizeof(SkString*), SkCastForQSort(compare_file_name_metrics));
+        std::sort(comparisonFiles.begin(), comparisonFiles.end(), compare_file_name_metrics);
     }
 
     if (!outputDir.isEmpty()) {