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
This commit is contained in:
commit-bot@chromium.org 2014-02-20 15:41:17 +00:00
parent 0dd2109c7e
commit 63822639e4

View File

@ -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 {