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/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index 7461f66..8cc8892 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -13,7 +13,6 @@
#include "include/private/SkOnce.h"
#include "include/private/SkTDArray.h"
#include "src/core/SkTSearch.h"
-#include "src/core/SkTSort.h"
bool SkWGLExtensions::hasExtension(HDC dc, const char* ext) const {
if (nullptr == this->fGetExtensionsString) {
@@ -150,9 +149,7 @@
rankedFormats[i].fSampleCnt = std::max(1, numSamples);
rankedFormats[i].fChoosePixelFormatRank = i;
}
- SkTQSort(rankedFormats.begin(),
- rankedFormats.begin() + rankedFormats.count() - 1,
- SkTLessFunctionToFunctorAdaptor<PixelFormat, pf_less>());
+ std::sort(rankedFormats.begin(), rankedFormats.end(), pf_less);
int idx = SkTSearch<PixelFormat, pf_less>(rankedFormats.begin(),
rankedFormats.count(),
desiredFormat,