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

Unified Diff: samplecode/SampleSubpixelTranslate.cpp

Issue 346453002: Refactor how we handle resources path in Tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rebase conflict Created 6 years, 6 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 | « samplecode/SamplePicture.cpp ('k') | samplecode/SampleUnpremul.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleSubpixelTranslate.cpp
diff --git a/samplecode/SampleSubpixelTranslate.cpp b/samplecode/SampleSubpixelTranslate.cpp
index afb31c162cb4bec26f80e42ffad5a1562b5e1e21..41a0f156c15c258bd6845bb457bd2c2809dc64e5 100644
--- a/samplecode/SampleSubpixelTranslate.cpp
+++ b/samplecode/SampleSubpixelTranslate.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2014 Google Inc.
*
@@ -7,10 +6,12 @@
*/
#include "gm.h"
+
+#include "Resources.h"
#include "SampleCode.h"
#include "SkBlurMaskFilter.h"
-#include "SkColorPriv.h"
#include "SkCanvas.h"
+#include "SkColorPriv.h"
#include "SkImageDecoder.h"
#include "SkRandom.h"
#include "SkStream.h"
@@ -26,12 +27,12 @@ public:
: fFilename(imageFilename),
fHorizontalVelocity(horizontalVelocity),
fVerticalVelocity(verticalVelocity) {
- SkString path(skiagm::GM::GetResourcePath());
- path.append("/");
- path.append(fFilename);
+ SkString resourcePath = GetResourcePath();
+ resourcePath.append("/");
+ resourcePath.append(fFilename);
- SkImageDecoder *codec = NULL;
- SkFILEStream stream(path.c_str());
+ SkImageDecoder* codec = NULL;
+ SkFILEStream stream(resourcePath.c_str());
if (stream.isValid()) {
codec = SkImageDecoder::Factory(&stream);
}
« no previous file with comments | « samplecode/SamplePicture.cpp ('k') | samplecode/SampleUnpremul.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698