aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2016-11-07 18:05:29 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-08 20:20:15 +0000
commitbf111d7bc9ba3857433e30eae27f0272c34ed0fb (patch)
tree878660f011e2513791d588b621bc16fa047484da
parentfa2c4788ce04f80ff7a5887613d93a4053cd174b (diff)
Move SkOSPath out of include/core.
It is moved to src/utils. It is almost a tool, but has two uses in src/ports. The existing SkOSFile.cpp is left empty for the time being since it is mentioned in Chromium's BUILD.gn for Skia. Change-Id: I3bb7f7c4214359eb6ab906bfe76737d20bf1d6c7 Reviewed-on: https://skia-review.googlesource.com/4536 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
-rw-r--r--bench/ResultsWriter.h1
-rw-r--r--bench/nanobench.cpp1
-rw-r--r--dm/DM.cpp1
-rw-r--r--dm/DMJsonWriter.cpp1
-rw-r--r--dm/DMSrcSink.cpp1
-rw-r--r--gn/utils.gni2
-rw-r--r--include/core/SkOSFile.h43
-rw-r--r--samplecode/SampleApp.cpp1
-rw-r--r--samplecode/SamplePictFile.cpp3
-rw-r--r--samplecode/SampleSVGFile.cpp1
-rw-r--r--samplecode/SampleUnpremul.cpp1
-rw-r--r--src/ports/SkFontMgr_custom.cpp1
-rw-r--r--src/utils/SkOSFile.cpp40
-rw-r--r--src/utils/SkOSPath.cpp45
-rw-r--r--src/utils/SkOSPath.h55
-rw-r--r--tests/BadIcoTest.cpp4
-rw-r--r--tests/DataRefTest.cpp1
-rw-r--r--tests/OSPathTest.cpp24
-rw-r--r--tests/PDFDocumentTest.cpp1
-rw-r--r--tests/StreamTest.cpp1
-rw-r--r--tools/Resources.cpp1
-rw-r--r--tools/flags/SkCommonFlags.cpp1
-rw-r--r--tools/get_images_from_skps.cpp1
-rw-r--r--tools/picture_utils.cpp1
-rw-r--r--tools/skdiff/skdiff_main.cpp3
-rw-r--r--tools/skpbench/skpbench.cpp1
-rw-r--r--tools/viewer/Viewer.cpp1
27 files changed, 140 insertions, 97 deletions
diff --git a/bench/ResultsWriter.h b/bench/ResultsWriter.h
index f56deae209..dc50ace560 100644
--- a/bench/ResultsWriter.h
+++ b/bench/ResultsWriter.h
@@ -13,6 +13,7 @@
#include "BenchLogger.h"
#include "SkJSONCPP.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "SkString.h"
#include "SkTypes.h"
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 25e04bf77d..9b4db96d01 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -36,6 +36,7 @@
#include "SkGraphics.h"
#include "SkLeanWindows.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPictureRecorder.h"
#include "SkPictureUtils.h"
#include "SkString.h"
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 5f4203c962..d42a5f094a 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -25,6 +25,7 @@
#include "SkMD5.h"
#include "SkMutex.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPM4fPriv.h"
#include "SkSpinlock.h"
#include "SkTHash.h"
diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp
index 79f308f2ba..9ec83f8f45 100644
--- a/dm/DMJsonWriter.cpp
+++ b/dm/DMJsonWriter.cpp
@@ -13,6 +13,7 @@
#include "SkJSONCPP.h"
#include "SkMutex.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "SkTArray.h"
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 2c5ee16e75..3bef299d65 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -27,6 +27,7 @@
#include "SkMultiPictureDraw.h"
#include "SkNullCanvas.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkOpts.h"
#include "SkPictureData.h"
#include "SkPictureRecorder.h"
diff --git a/gn/utils.gni b/gn/utils.gni
index 745ea7f3ba..4e414b9be0 100644
--- a/gn/utils.gni
+++ b/gn/utils.gni
@@ -55,6 +55,8 @@ skia_utils_sources = [
"$_src/utils/SkNWayCanvas.cpp",
"$_src/utils/SkNullCanvas.cpp",
"$_src/utils/SkOSFile.cpp",
+ "$_src/utils/SkOSPath.cpp",
+ "$_src/utils/SkOSPath.h",
"$_src/utils/SkPaintFilterCanvas.cpp",
"$_src/utils/SkParse.cpp",
"$_src/utils/SkParseColor.cpp",
diff --git a/include/core/SkOSFile.h b/include/core/SkOSFile.h
index f977327e25..876135596b 100644
--- a/include/core/SkOSFile.h
+++ b/include/core/SkOSFile.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 The Android Open Source Project
*
@@ -21,12 +20,6 @@ enum SkFILE_Flags {
kWrite_SkFILE_Flag = 0x02
};
-#ifdef _WIN32
-const static char SkPATH_SEPARATOR = '\\';
-#else
-const static char SkPATH_SEPARATOR = '/';
-#endif
-
FILE* sk_fopen(const char path[], SkFILE_Flags);
void sk_fclose(FILE*);
@@ -110,40 +103,4 @@ public:
};
};
-/**
- * Functions for modifying SkStrings which represent paths on the filesystem.
- */
-class SkOSPath {
-public:
- /**
- * Assembles rootPath and relativePath into a single path, like this:
- * rootPath/relativePath.
- * It is okay to call with a NULL rootPath and/or relativePath. A path
- * separator will still be inserted.
- *
- * Uses SkPATH_SEPARATOR, to work on all platforms.
- */
- static SkString Join(const char* rootPath, const char* relativePath);
-
- /**
- * Return the name of the file, ignoring the directory structure.
- * Behaves like python's os.path.basename. If the fullPath is
- * /dir/subdir/, an empty string is returned.
- * @param fullPath Full path to the file.
- * @return SkString The basename of the file - anything beyond the
- * final slash, or the full name if there is no slash.
- */
- static SkString Basename(const char* fullPath);
-
- /**
- * Given a qualified file name returns the directory.
- * Behaves like python's os.path.dirname. If the fullPath is
- * /dir/subdir/ the return will be /dir/subdir/
- * @param fullPath Full path to the file.
- * @return SkString The dir containing the file - anything preceding the
- * final slash, or the full name if ending in a slash.
- */
- static SkString Dirname(const char* fullPath);
-};
-
#endif
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 75827ffe40..8a5927fcc3 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -21,6 +21,7 @@
#include "SkImage_Base.h"
#include "SkImageEncoder.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPaint.h"
#include "SkPaintFilterCanvas.h"
#include "SkPicture.h"
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp
index a826edd14f..83912a5e2f 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -13,6 +13,7 @@
#include "SkGradientShader.h"
#include "SkGraphics.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPath.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
@@ -77,7 +78,7 @@ protected:
bool onQuery(SkEvent* evt) override {
if (SampleCode::TitleQ(*evt)) {
SkString name("P:");
- const char* basename = strrchr(fFilename.c_str(), SkPATH_SEPARATOR);
+ const char* basename = strrchr(fFilename.c_str(), SkOSPath::SEPARATOR);
name.append(basename ? basename+1: fFilename.c_str());
switch (fBBox) {
case kNo_BBoxType:
diff --git a/samplecode/SampleSVGFile.cpp b/samplecode/SampleSVGFile.cpp
index 61a6be73d6..efffb20d7a 100644
--- a/samplecode/SampleSVGFile.cpp
+++ b/samplecode/SampleSVGFile.cpp
@@ -9,6 +9,7 @@
#include "SkCanvas.h"
#include "SkDOM.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "SkSVGDOM.h"
#include "SkView.h"
diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp
index 919fb64e75..558bf935f1 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -16,6 +16,7 @@
#include "SkCanvas.h"
#include "SkColorPriv.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "SkString.h"
#include "SkSystemEventTypes.h"
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index c081064fad..ada7d0b190 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -12,6 +12,7 @@
#include "SkFontStyle.h"
#include "SkMakeUnique.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkRefCnt.h"
#include "SkStream.h"
#include "SkString.h"
diff --git a/src/utils/SkOSFile.cpp b/src/utils/SkOSFile.cpp
index a0c003ba8d..e10e67491f 100644
--- a/src/utils/SkOSFile.cpp
+++ b/src/utils/SkOSFile.cpp
@@ -1,44 +1,6 @@
/*
- * Copyright 2011 Google Inc.
+ * Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "SkOSFile.h"
-
-SkString SkOSPath::Join(const char *rootPath, const char *relativePath) {
- SkString result(rootPath);
- if (!result.endsWith(SkPATH_SEPARATOR) && !result.isEmpty()) {
- result.appendUnichar(SkPATH_SEPARATOR);
- }
- result.append(relativePath);
- return result;
-}
-
-SkString SkOSPath::Basename(const char* fullPath) {
- if (!fullPath) {
- return SkString();
- }
- const char* filename = strrchr(fullPath, SkPATH_SEPARATOR);
- if (nullptr == filename) {
- filename = fullPath;
- } else {
- ++filename;
- }
- return SkString(filename);
-}
-
-SkString SkOSPath::Dirname(const char* fullPath) {
- if (!fullPath) {
- return SkString();
- }
- const char* end = strrchr(fullPath, SkPATH_SEPARATOR);
- if (nullptr == end) {
- return SkString();
- }
- if (end == fullPath) {
- SkASSERT(fullPath[0] == SkPATH_SEPARATOR);
- ++end;
- }
- return SkString(fullPath, end - fullPath);
-}
diff --git a/src/utils/SkOSPath.cpp b/src/utils/SkOSPath.cpp
new file mode 100644
index 0000000000..d9a5ac53f3
--- /dev/null
+++ b/src/utils/SkOSPath.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkOSPath.h"
+
+SkString SkOSPath::Join(const char *rootPath, const char *relativePath) {
+ SkString result(rootPath);
+ if (!result.endsWith(SEPARATOR) && !result.isEmpty()) {
+ result.appendUnichar(SEPARATOR);
+ }
+ result.append(relativePath);
+ return result;
+}
+
+SkString SkOSPath::Basename(const char* fullPath) {
+ if (!fullPath) {
+ return SkString();
+ }
+ const char* filename = strrchr(fullPath, SEPARATOR);
+ if (nullptr == filename) {
+ filename = fullPath;
+ } else {
+ ++filename;
+ }
+ return SkString(filename);
+}
+
+SkString SkOSPath::Dirname(const char* fullPath) {
+ if (!fullPath) {
+ return SkString();
+ }
+ const char* end = strrchr(fullPath, SEPARATOR);
+ if (nullptr == end) {
+ return SkString();
+ }
+ if (end == fullPath) {
+ SkASSERT(fullPath[0] == SEPARATOR);
+ ++end;
+ }
+ return SkString(fullPath, end - fullPath);
+}
diff --git a/src/utils/SkOSPath.h b/src/utils/SkOSPath.h
new file mode 100644
index 0000000000..5f73289cf5
--- /dev/null
+++ b/src/utils/SkOSPath.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkOSPath_DEFINED
+#define SkOSPath_DEFINED
+
+#include "SkString.h"
+
+/**
+ * Functions for modifying SkStrings which represent paths on the filesystem.
+ */
+class SkOSPath {
+public:
+#ifdef _WIN32
+ const static char SEPARATOR = '\\';
+#else
+ const static char SEPARATOR = '/';
+#endif
+
+ /**
+ * Assembles rootPath and relativePath into a single path, like this:
+ * rootPath/relativePath.
+ * It is okay to call with a NULL rootPath and/or relativePath. A path
+ * separator will still be inserted.
+ *
+ * Uses SkPATH_SEPARATOR, to work on all platforms.
+ */
+ static SkString Join(const char* rootPath, const char* relativePath);
+
+ /**
+ * Return the name of the file, ignoring the directory structure.
+ * Behaves like python's os.path.basename. If the fullPath is
+ * /dir/subdir/, an empty string is returned.
+ * @param fullPath Full path to the file.
+ * @return SkString The basename of the file - anything beyond the
+ * final slash, or the full name if there is no slash.
+ */
+ static SkString Basename(const char* fullPath);
+
+ /**
+ * Given a qualified file name returns the directory.
+ * Behaves like python's os.path.dirname. If the fullPath is
+ * /dir/subdir/ the return will be /dir/subdir/
+ * @param fullPath Full path to the file.
+ * @return SkString The dir containing the file - anything preceding the
+ * final slash, or the full name if ending in a slash.
+ */
+ static SkString Dirname(const char* fullPath);
+};
+
+#endif
diff --git a/tests/BadIcoTest.cpp b/tests/BadIcoTest.cpp
index a0664f1c5e..229e9bc44e 100644
--- a/tests/BadIcoTest.cpp
+++ b/tests/BadIcoTest.cpp
@@ -7,10 +7,12 @@
#include "Resources.h"
#include "Test.h"
+
#include "SkBitmap.h"
#include "SkCodec.h"
-#include "SkStream.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
+#include "SkStream.h"
DEF_TEST(BadImage, reporter) {
const char* const badImages [] = {
diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp
index ab33d8c09c..d6e994cb65 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -8,6 +8,7 @@
#include "SkData.h"
#include "SkDataTable.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkStream.h"
diff --git a/tests/OSPathTest.cpp b/tests/OSPathTest.cpp
index 3276145fa4..22deff80a5 100644
--- a/tests/OSPathTest.cpp
+++ b/tests/OSPathTest.cpp
@@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
-#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkString.h"
#include "Test.h"
@@ -15,24 +15,24 @@
* and tests using SkOSPath::Basename on the result.
* @param reporter Reporter for test conditions.
* @param dir String representing the path to a folder. May or may not
- * end with SkPATH_SEPARATOR.
+ * end with SkOSPath::SEPARATOR.
* @param filename String representing the basename of a file. Must NOT
- * contain SkPATH_SEPARATOR.
+ * contain SkOSPath::SEPARATOR.
*/
static void test_dir_with_file(skiatest::Reporter* reporter, SkString dir,
SkString filename) {
- // If filename contains SkPATH_SEPARATOR, the tests will fail.
- SkASSERT(!filename.contains(SkPATH_SEPARATOR));
+ // If filename contains SkOSPath::SEPARATOR, the tests will fail.
+ SkASSERT(!filename.contains(SkOSPath::SEPARATOR));
// Tests for SkOSPath::Join and SkOSPath::Basename
- // fullName should be "dir<SkPATH_SEPARATOR>file"
+ // fullName should be "dir<SkOSPath::SEPARATOR>file"
SkString fullName = SkOSPath::Join(dir.c_str(), filename.c_str());
// fullName should be the combined size of dir and file, plus one if
// dir did not include the final path separator.
size_t expectedSize = dir.size() + filename.size();
- if (!dir.endsWith(SkPATH_SEPARATOR) && !dir.isEmpty()) {
+ if (!dir.endsWith(SkOSPath::SEPARATOR) && !dir.isEmpty()) {
expectedSize++;
}
REPORTER_ASSERT(reporter, fullName.size() == expectedSize);
@@ -46,7 +46,7 @@ static void test_dir_with_file(skiatest::Reporter* reporter, SkString dir,
// dirname should be the same as dir with any trailing seperators removed.
// Except when the the string is just "/".
SkString strippedDir = dir;
- while (strippedDir.size() > 2 && strippedDir[strippedDir.size() - 1] == SkPATH_SEPARATOR) {
+ while (strippedDir.size() > 2 && strippedDir[strippedDir.size() - 1] == SkOSPath::SEPARATOR) {
strippedDir.remove(strippedDir.size() - 1, 1);
}
if (!dirname.equals(strippedDir)) {
@@ -55,7 +55,7 @@ static void test_dir_with_file(skiatest::Reporter* reporter, SkString dir,
REPORTER_ASSERT(reporter, dirname.equals(strippedDir));
// basename will not contain a path separator
- REPORTER_ASSERT(reporter, !basename.contains(SkPATH_SEPARATOR));
+ REPORTER_ASSERT(reporter, !basename.contains(SkOSPath::SEPARATOR));
// Now take the basename of filename, which should be the same as filename.
basename = SkOSPath::Basename(filename.c_str());
@@ -68,7 +68,7 @@ DEF_TEST(OSPath, reporter) {
test_dir_with_file(reporter, dir, filename);
// Now make sure this works with a path separator at the end of dir.
- dir.appendUnichar(SkPATH_SEPARATOR);
+ dir.appendUnichar(SkOSPath::SEPARATOR);
test_dir_with_file(reporter, dir, filename);
// Test using no filename.
@@ -82,7 +82,7 @@ DEF_TEST(OSPath, reporter) {
test_dir_with_file(reporter, dir, filename);
// Basename of a directory with a path separator at the end is empty.
- dir.appendUnichar(SkPATH_SEPARATOR);
+ dir.appendUnichar(SkOSPath::SEPARATOR);
SkString baseOfDir = SkOSPath::Basename(dir.c_str());
REPORTER_ASSERT(reporter, baseOfDir.size() == 0);
@@ -91,7 +91,7 @@ DEF_TEST(OSPath, reporter) {
REPORTER_ASSERT(reporter, empty.size() == 0);
// File in root dir
- dir.printf("%c", SkPATH_SEPARATOR);
+ dir.printf("%c", SkOSPath::SEPARATOR);
filename.set("file");
test_dir_with_file(reporter, dir, filename);
diff --git a/tests/PDFDocumentTest.cpp b/tests/PDFDocumentTest.cpp
index afc05e49b8..fb3281920d 100644
--- a/tests/PDFDocumentTest.cpp
+++ b/tests/PDFDocumentTest.cpp
@@ -10,6 +10,7 @@
#include "SkCanvas.h"
#include "SkDocument.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "SkPixelSerializer.h"
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index b99b001193..b330745fb8 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -9,6 +9,7 @@
#include "SkData.h"
#include "SkFrontBufferedStream.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkRandom.h"
#include "SkStream.h"
#include "SkStreamPriv.h"
diff --git a/tools/Resources.cpp b/tools/Resources.cpp
index dcca202e42..3a9bb58c4e 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -12,6 +12,7 @@
#include "SkImage.h"
#include "SkImageGenerator.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "SkTypeface.h"
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index a0aa94bdc0..02d8054f23 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -7,6 +7,7 @@
#include "SkCommonFlags.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
DEFINE_bool(cpu, true, "master switch for running CPU-bound work.");
diff --git a/tools/get_images_from_skps.cpp b/tools/get_images_from_skps.cpp
index b8a893001b..6cd35122ad 100644
--- a/tools/get_images_from_skps.cpp
+++ b/tools/get_images_from_skps.cpp
@@ -12,6 +12,7 @@
#include "SkJSONCPP.h"
#include "SkMD5.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPicture.h"
#include "SkPixelSerializer.h"
#include "SkStream.h"
diff --git a/tools/picture_utils.cpp b/tools/picture_utils.cpp
index b252f8da62..43ca2f07bf 100644
--- a/tools/picture_utils.cpp
+++ b/tools/picture_utils.cpp
@@ -11,6 +11,7 @@
#include "SkHalf.h"
#include "SkImageEncoder.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPM4fPriv.h"
#include "SkPicture.h"
#include "SkStream.h"
diff --git a/tools/skdiff/skdiff_main.cpp b/tools/skdiff/skdiff_main.cpp
index c51cd28d78..b4e560729c 100644
--- a/tools/skdiff/skdiff_main.cpp
+++ b/tools/skdiff/skdiff_main.cpp
@@ -12,6 +12,7 @@
#include "SkForceLinking.h"
#include "SkImageEncoder.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkStream.h"
#include "../private/SkTDArray.h"
#include "../private/SkTSearch.h"
@@ -40,7 +41,7 @@ typedef StringArray FileArray;
static void add_unique_basename(StringArray* array, const SkString& filename) {
// trim off dirs
const char* src = filename.c_str();
- const char* trimmed = strrchr(src, SkPATH_SEPARATOR);
+ const char* trimmed = strrchr(src, SkOSPath::SEPARATOR);
if (trimmed) {
trimmed += 1; // skip the separator
} else {
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp
index f452d9d025..897878e27d 100644
--- a/tools/skpbench/skpbench.cpp
+++ b/tools/skpbench/skpbench.cpp
@@ -9,6 +9,7 @@
#include "GrContextFactory.h"
#include "SkCanvas.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkPerlinNoiseShader.h"
#include "SkPicture.h"
#include "SkPictureRecorder.h"
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index d92b80139d..3db858a02d 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -19,6 +19,7 @@
#include "SkGraphics.h"
#include "SkMetaData.h"
#include "SkOSFile.h"
+#include "SkOSPath.h"
#include "SkRandom.h"
#include "SkStream.h"
#include "SkSurface.h"