diff options
author | 2014-02-20 15:41:17 +0000 | |
---|---|---|
committer | 2014-02-20 15:41:17 +0000 | |
commit | 63822639e47d08248b8f581ee707bd062bb85fee (patch) | |
tree | b9ab16d2e89c628367dcc29964f96978cf7ae586 /bench | |
parent | 0dd2109c7e25a15af132c2679281603d293eba4e (diff) |
Upstream fix for DecodeBench.
Use SkBasename to get the basename.
Fixes a bug on Android where calling strrchar conflicts with
Android's setting for FORTIFY_SOURCE.
R=djsollen@google.com
Author: scroggo@google.com
Review URL: https://codereview.chromium.org/170783012
git-svn-id: http://skia.googlecode.com/svn/trunk@13511 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r-- | bench/DecodeBench.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bench/DecodeBench.cpp b/bench/DecodeBench.cpp index 3f535d2f7c..a6ab4a5953 100644 --- a/bench/DecodeBench.cpp +++ b/bench/DecodeBench.cpp @@ -9,6 +9,7 @@ #include "SkBitmap.h" #include "SkCommandLineFlags.h" #include "SkImageDecoder.h" +#include "SkOSFile.h" #include "SkString.h" DEFINE_string(decodeBenchFilename, "resources/CMYK.jpeg", "Path to image for DecodeBench."); @@ -24,11 +25,8 @@ public: DecodeBench(SkBitmap::Config c) { fPrefConfig = c; - const char* fname = strrchr(FLAGS_decodeBenchFilename[0], '/'); - if (fname) { - fname++; // skip the slash - } - fName.printf("decode_%s_%s", gConfigName[c], fname); + SkString fname = SkOSPath::SkBasename(FLAGS_decodeBenchFilename[0]); + fName.printf("decode_%s_%s", gConfigName[c], fname.c_str()); } virtual bool isSuitableFor(Backend backend) SK_OVERRIDE { |