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

Unified Diff: gm/factory.cpp

Issue 15747004: Add path utils, plus a test for it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/gm_expectations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/factory.cpp
diff --git a/gm/factory.cpp b/gm/factory.cpp
index 4538cda8945d007fdbbbeb859af86a075f16c9c7..a7356a96e30a61288c5be5aaa883a201fbe21927 100644
--- a/gm/factory.cpp
+++ b/gm/factory.cpp
@@ -11,6 +11,7 @@
#include "SkData.h"
#include "SkImageDecoder.h"
#include "SkLruImageCache.h"
+#include "SkOSFile.h"
#include "SkStream.h"
namespace skiagm {
@@ -24,13 +25,9 @@ public:
protected:
virtual void onOnceBeforeDraw() SK_OVERRIDE {
- SkString filename(INHERITED::gResourcePath);
- if (!filename.endsWith("/") && !filename.endsWith("\\")) {
- filename.append("/");
- }
-
// Copyright-free file from http://openclipart.org/detail/29213/paper-plane-by-ddoo
- filename.append("plane.png");
+ SkString filename = SkOSPath::SkPathJoin(INHERITED::gResourcePath.c_str(),
+ "plane.png");
SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(filename.c_str()));
if (NULL != stream.get()) {
« no previous file with comments | « no previous file | gm/gm_expectations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698