Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include <ctype.h> | 8 #include <ctype.h> |
| 9 | 9 |
| 10 #include "nanobench.h" | 10 #include "nanobench.h" |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 kRGB_565_SkColorType, | 602 kRGB_565_SkColorType, |
| 603 kAlpha_8_SkColorType, | 603 kAlpha_8_SkColorType, |
| 604 kIndex_8_SkColorType, | 604 kIndex_8_SkColorType, |
| 605 kGray_8_SkColorType }; | 605 kGray_8_SkColorType }; |
| 606 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); | 606 fColorTypes.reset(colorTypes, SK_ARRAY_COUNT(colorTypes)); |
| 607 } | 607 } |
| 608 | 608 |
| 609 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) { | 609 static bool ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) { |
| 610 // Not strictly necessary, as it will be checked again later, | 610 // Not strictly necessary, as it will be checked again later, |
| 611 // but helps to avoid a lot of pointless work if we're going to skip it. | 611 // but helps to avoid a lot of pointless work if we're going to skip it. |
| 612 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, path)) { | 612 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, SkOSPath::Basename(path) .c_str())) { |
|
Chris Dalton
2016/02/17 18:21:36
I can think of a more elaborate fix if we want to
| |
| 613 return false; | 613 return false; |
| 614 } | 614 } |
| 615 | 615 |
| 616 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); | 616 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); |
| 617 if (stream.get() == nullptr) { | 617 if (stream.get() == nullptr) { |
| 618 SkDebugf("Could not read %s.\n", path); | 618 SkDebugf("Could not read %s.\n", path); |
| 619 return false; | 619 return false; |
| 620 } | 620 } |
| 621 | 621 |
| 622 pic->reset(SkPicture::CreateFromStream(stream.get())); | 622 pic->reset(SkPicture::CreateFromStream(stream.get())); |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1275 | 1275 |
| 1276 return 0; | 1276 return 0; |
| 1277 } | 1277 } |
| 1278 | 1278 |
| 1279 #if !defined SK_BUILD_FOR_IOS | 1279 #if !defined SK_BUILD_FOR_IOS |
| 1280 int main(int argc, char** argv) { | 1280 int main(int argc, char** argv) { |
| 1281 SkCommandLineFlags::Parse(argc, argv); | 1281 SkCommandLineFlags::Parse(argc, argv); |
| 1282 return nanobench_main(); | 1282 return nanobench_main(); |
| 1283 } | 1283 } |
| 1284 #endif | 1284 #endif |
| OLD | NEW |