aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/filterindiabox.cpp
diff options
context:
space:
mode:
authorGravatar tfarina <tfarina@chromium.org>2014-06-18 14:32:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-18 14:32:49 -0700
commitbcbc1788b478b1e54079318ad073e8490aa66fae (patch)
tree5492557ad07a5917364b69721788bc5ec471954a /gm/filterindiabox.cpp
parent6518eaaefac27a823c55c16c12b3c698f09aabf5 (diff)
Refactor how we handle resources path in Tests.
This idea emerged while doing https://codereview.chromium.org/321723002/ (commit 880914c35c8f7fc2e9c57134134c883baf66e538). BUG=None TEST=make tests && out/Debug/tests R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/346453002
Diffstat (limited to 'gm/filterindiabox.cpp')
-rw-r--r--gm/filterindiabox.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/gm/filterindiabox.cpp b/gm/filterindiabox.cpp
index 4acb2c3a71..1987c95bf7 100644
--- a/gm/filterindiabox.cpp
+++ b/gm/filterindiabox.cpp
@@ -6,15 +6,15 @@
*/
#include "gm.h"
-#include "SkGradientShader.h"
-#include "SkTypeface.h"
+#include "Resources.h"
+#include "SkBitmapProcState.h"
+#include "SkBitmapScaler.h"
+#include "SkGradientShader.h"
#include "SkImageDecoder.h"
-#include "SkStream.h"
-
#include "SkImageEncoder.h"
-#include "SkBitmapScaler.h"
-#include "SkBitmapProcState.h"
+#include "SkStream.h"
+#include "SkTypeface.h"
static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) {
SkRect bounds = SkRect::MakeWH(SkIntToScalar(bm.width()),
@@ -104,12 +104,12 @@ protected:
}
void makeBitmap() {
- SkString path(skiagm::GM::gResourcePath);
- 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);
}