aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-06-18 15:11:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 02:06:31 +0000
commitf08d1d0ce19c72bb911f059dcf916cf99a0a2467 (patch)
tree65fed059b8bd2b730c86e202cc8475fb60b76455 /src/ports
parent93724202640b1f5ae9ccf7646151c9c3bb5afa5c (diff)
Stop using SkTSwap.
Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontHost_FreeType_common.cpp5
-rw-r--r--src/ports/SkFontHost_mac.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp
index 5627304956..bd15834775 100644
--- a/src/ports/SkFontHost_FreeType_common.cpp
+++ b/src/ports/SkFontHost_FreeType_common.cpp
@@ -15,6 +15,8 @@
#include "SkPath.h"
#include "SkTo.h"
+#include <utility>
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_BITMAP_H
@@ -161,7 +163,8 @@ void copyFT2LCD16(const FT_Bitmap& bitmap, const SkMask& mask, int lcdIsBGR,
const uint8_t* srcG = srcR + bitmap.pitch;
const uint8_t* srcB = srcG + bitmap.pitch;
if (lcdIsBGR) {
- SkTSwap(srcR, srcB);
+ using std::swap;
+ swap(srcR, srcB);
}
for (int x = 0; x < width; x++) {
dst[x] = packTriple(sk_apply_lut_if<APPLY_PREBLEND>(*srcR++, tableR),
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 4c06e960a6..18d09b4ec0 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -49,6 +49,8 @@
#include <dlfcn.h>
+#include <utility>
+
// Experimental code to use a global lock whenever we access CG, to see if this reduces
// crashes in Chrome
#define USE_GLOBAL_MUTEX_FOR_CG_ACCESS
@@ -1170,7 +1172,8 @@ void SkScalerContext_Mac::generateMetrics(SkGlyph* glyph) {
CTFontGetAdvancesForGlyphs(fCTFont.get(), kCTFontOrientationVertical,
&cgGlyph, &cgAdvance, 1);
// Vertical advances are returned as widths instead of heights.
- SkTSwap(cgAdvance.height, cgAdvance.width);
+ using std::swap;
+ swap(cgAdvance.height, cgAdvance.width);
cgAdvance.height = -cgAdvance.height;
} else {
CTFontGetAdvancesForGlyphs(fCTFont.get(), kCTFontOrientationHorizontal,