Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7f36405

Browse files
brianosmanSkia Commit-Bot
authored andcommitted
Remove SkMin32/SkMax32
Use std::max and std::min instead Change-Id: I7fd2626ea9ea8ea09c709ff962523ca3de2f8a16 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269136 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
1 parent 18b90bc commit 7f36405

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+89
-97
lines changed

RELEASE_NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file includes a list of high level updates for each milestone release.
77
Milestone 82
88

99
<Insert new notes here- top is most recent.>
10+
* Removed SkMax32 and SkMin32.
1011
* Removed SkMaxScalar and SkMinScalar.
1112

1213
* SkColorSetA now warns if the result is unused.

bench/AlternatingColorPatternBench.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static void makebm(SkBitmap* bm, int w, int h) {
4242
bm->eraseColor(SK_ColorTRANSPARENT);
4343

4444
SkCanvas canvas(*bm);
45-
SkScalar s = SkIntToScalar(SkMin32(w, h));
45+
SkScalar s = SkIntToScalar(std::min(w, h));
4646
static const SkPoint kPts0[] = { { 0, 0 }, { s, s } };
4747
static const SkPoint kPts1[] = { { s/2, 0 }, { s/2, s } };
4848
static const SkScalar kPos[] = { 0, SK_Scalar1/2, SK_Scalar1 };

bench/BitmapBench.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class BitmapBench : public Benchmark {
110110
p.setAntiAlias(true);
111111
p.setColor(SK_ColorRED);
112112
canvas.drawCircle(SkIntToScalar(w)/2, SkIntToScalar(h)/2,
113-
SkIntToScalar(SkMin32(w, h))*3/8, p);
113+
SkIntToScalar(std::min(w, h))*3/8, p);
114114

115115
SkRect r;
116116
r.setWH(SkIntToScalar(w), SkIntToScalar(h));

bench/BitmapRectBench.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static void draw_into_bitmap(const SkBitmap& bm) {
2323
p.setAntiAlias(true);
2424
p.setColor(SK_ColorRED);
2525
canvas.drawCircle(SkIntToScalar(w)/2, SkIntToScalar(h)/2,
26-
SkIntToScalar(SkMin32(w, h))*3/8, p);
26+
SkIntToScalar(std::min(w, h))*3/8, p);
2727

2828
SkRect r;
2929
r.setWH(SkIntToScalar(w), SkIntToScalar(h));

bench/ChartBench.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ChartBench : public Benchmark {
115115

116116
SkScalar height = SkIntToScalar(fSize.fHeight);
117117
if (sizeChanged) {
118-
int dataPointCount = SkMax32(fSize.fWidth / kPixelsPerTick + 1, 2);
118+
int dataPointCount = std::max(fSize.fWidth / kPixelsPerTick + 1, 2);
119119

120120
SkRandom random;
121121
for (int i = 0; i < kNumGraphs; ++i) {

bench/FontCacheBench.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class FontCacheEfficiency : public Benchmark {
125125
int glyphs = 0;
126126
const uint16_t* array = gUniqueGlyphIDs;
127127
while (*array != gUniqueGlyphIDs_Sentinel) {
128-
int count = SkMin32(count_glyphs(array), limit);
128+
int count = std::min(count_glyphs(array), limit);
129129
collisions += count_collisions(array, count, gRec[i].fHasher, hashMask);
130130
glyphs += count;
131131
array += count + 1; // skip the sentinel

bench/RepeatTileBench.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void draw_into_bitmap(const SkBitmap& bm) {
2222
p.setAntiAlias(true);
2323
p.setColor(SK_ColorRED);
2424
canvas.drawCircle(SkIntToScalar(w)/2, SkIntToScalar(h)/2,
25-
SkIntToScalar(SkMin32(w, h))*3/8, p);
25+
SkIntToScalar(std::min(w, h))*3/8, p);
2626

2727
SkRect r;
2828
r.setWH(SkIntToScalar(w), SkIntToScalar(h));

gm/fontmgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class FontMgrGM : public skiagm::GM {
8888
font.setSize(17);
8989

9090
SkFontMgr* fm = fFM.get();
91-
int count = SkMin32(fm->countFamilies(), MAX_FAMILIES);
91+
int count = std::min(fm->countFamilies(), MAX_FAMILIES);
9292

9393
for (int i = 0; i < count; ++i) {
9494
SkString familyName;
@@ -316,7 +316,7 @@ class FontMgrBoundsGM : public skiagm::GM {
316316
const SkColor boundsColors[2] = { SK_ColorRED, SK_ColorBLUE };
317317

318318
SkFontMgr* fm = fFM.get();
319-
int count = SkMin32(fm->countFamilies(), 32);
319+
int count = std::min(fm->countFamilies(), 32);
320320

321321
int index = 0;
322322
SkScalar x = 0, y = 0;

gm/modecolorfilters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class ModeColorFilterGM : public GM {
133133

134134
SkPaint paint;
135135
int idx = 0;
136-
const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
136+
const int kRectsPerRow = std::max(this->getISize().fWidth / kRectWidth, 1);
137137
for (size_t cfm = 0; cfm < SK_ARRAY_COUNT(modes); ++cfm) {
138138
for (size_t cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
139139
paint.setColorFilter(SkColorFilters::Blend(colors[cfc], modes[cfm]));

gm/shadertext3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static void makebm(SkBitmap* bm, int w, int h) {
3434
bm->eraseColor(SK_ColorTRANSPARENT);
3535

3636
SkCanvas canvas(*bm);
37-
SkScalar s = SkIntToScalar(SkMin32(w, h));
37+
SkScalar s = SkIntToScalar(std::min(w, h));
3838
const SkPoint kPts0[] = { { 0, 0 }, { s, s } };
3939
const SkPoint kPts1[] = { { s/2, 0 }, { s/2, s } };
4040
const SkScalar kPos[] = { 0, SK_Scalar1/2, SK_Scalar1 };

0 commit comments

Comments
 (0)