Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: src/core/SkTSort.h

Issue 2041943002: SkLeanWindows.h: #include "Windows.h" fewer places (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-06-07 (Tuesday) 11:28:42 EDT Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkSemaphore.cpp ('k') | src/core/SkTaskGroup.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkTSort_DEFINED 9 #ifndef SkTSort_DEFINED
10 #define SkTSort_DEFINED 10 #define SkTSort_DEFINED
11 11
12 #include "SkTypes.h" 12 #include "SkTypes.h"
13 #include "SkMath.h" 13 #include "SkMathPriv.h"
14 14
15 /* A comparison functor which performs the comparison 'a < b'. */ 15 /* A comparison functor which performs the comparison 'a < b'. */
16 template <typename T> struct SkTCompareLT { 16 template <typename T> struct SkTCompareLT {
17 bool operator()(const T a, const T b) const { return a < b; } 17 bool operator()(const T a, const T b) const { return a < b; }
18 }; 18 };
19 19
20 /* A comparison functor which performs the comparison '*a < *b'. */ 20 /* A comparison functor which performs the comparison '*a < *b'. */
21 template <typename T> struct SkTPointerCompareLT { 21 template <typename T> struct SkTPointerCompareLT {
22 bool operator()(const T* a, const T* b) const { return *a < *b; } 22 bool operator()(const T* a, const T* b) const { return *a < *b; }
23 }; 23 };
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 template <typename T> void SkTQSort(T* left, T* right) { 200 template <typename T> void SkTQSort(T* left, T* right) {
201 SkTQSort(left, right, SkTCompareLT<T>()); 201 SkTQSort(left, right, SkTCompareLT<T>());
202 } 202 }
203 203
204 /** Sorts the region from left to right using comparator '* < *' using a Quick S ort algorithm. */ 204 /** Sorts the region from left to right using comparator '* < *' using a Quick S ort algorithm. */
205 template <typename T> void SkTQSort(T** left, T** right) { 205 template <typename T> void SkTQSort(T** left, T** right) {
206 SkTQSort(left, right, SkTPointerCompareLT<T>()); 206 SkTQSort(left, right, SkTPointerCompareLT<T>());
207 } 207 }
208 208
209 #endif 209 #endif
OLDNEW
« no previous file with comments | « src/core/SkSemaphore.cpp ('k') | src/core/SkTaskGroup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698