Reland 'Add path utils, plus a test for it.'

Build SkPathJoin and SkBasename on windows also.

Previous CL did not build on Windows because the two functions were
accidentally placed inside an ifdef that did not include windows.
Move the functions to the top of the file, and add a comment by the
endif for clarity.

Previously reviewed at https://codereview.chromium.org/15747004/

Review URL: https://codereview.chromium.org/15740024

git-svn-id: http://skia.googlecode.com/svn/trunk@9295 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gm_expectations.cpp b/gm/gm_expectations.cpp
index 08461bd..2f92120 100644
--- a/gm/gm_expectations.cpp
+++ b/gm/gm_expectations.cpp
@@ -37,15 +37,6 @@
         va_end(args);
     }
 
-    SkString SkPathJoin(const char *rootPath, const char *relativePath) {
-        SkString result(rootPath);
-        if (!result.endsWith(SkPATH_SEPARATOR)) {
-            result.appendUnichar(SkPATH_SEPARATOR);
-        }
-        result.append(relativePath);
-        return result;
-    }
-
     Json::Value CreateJsonTree(Json::Value expectedResults,
                                Json::Value actualResultsFailed,
                                Json::Value actualResultsFailureIgnored,
@@ -194,7 +185,7 @@
     // IndividualImageExpectationsSource class...
 
     Expectations IndividualImageExpectationsSource::get(const char *testName) {
-        SkString path = SkPathJoin(fRootDir.c_str(), testName);
+        SkString path = SkOSPath::SkPathJoin(fRootDir.c_str(), testName);
         SkBitmap referenceBitmap;
         bool decodedReferenceBitmap =
             SkImageDecoder::DecodeFile(path.c_str(), &referenceBitmap,