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

Unified Diff: gm/cmykjpeg.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 | « dm/DM.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/cmykjpeg.cpp
diff --git a/gm/cmykjpeg.cpp b/gm/cmykjpeg.cpp
index 2d0c275b8ded563001edaedef1c727cf6ed00c28..a1a12dc3885b41ce7e368c6830e1f0bd57800965 100644
--- a/gm/cmykjpeg.cpp
+++ b/gm/cmykjpeg.cpp
@@ -6,6 +6,8 @@
*/
#include "gm.h"
+
+#include "Resources.h"
#include "SkCanvas.h"
#include "SkImageDecoder.h"
#include "SkStream.h"
@@ -21,18 +23,17 @@ public:
protected:
virtual void onOnceBeforeDraw() SK_OVERRIDE {
-
// parameters to the "decode" call
bool dither = false;
- SkString filename(INHERITED::gResourcePath);
- if (!filename.endsWith("/") && !filename.endsWith("\\")) {
- filename.append("/");
+ SkString resourcePath = GetResourcePath();
+ if (!resourcePath.endsWith("/") && !resourcePath.endsWith("\\")) {
+ resourcePath.append("/");
}
- filename.append("CMYK.jpg");
+ resourcePath.append("CMYK.jpg");
- SkFILEStream stream(filename.c_str());
+ SkFILEStream stream(resourcePath.c_str());
if (!stream.isValid()) {
SkDebugf("Could not find CMYK.jpg, please set --resourcePath correctly.\n");
return;
« no previous file with comments | « dm/DM.cpp ('k') | gm/coloremoji.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698