| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "BenchLogger.h" | 8 #include "BenchLogger.h" |
| 9 #include "Benchmark.h" | 9 #include "Benchmark.h" |
| 10 #include "CrashHandler.h" | 10 #include "CrashHandler.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 static void saveFile(const char name[], const char config[], const char dir[], | 101 static void saveFile(const char name[], const char config[], const char dir[], |
| 102 const SkImage* image) { | 102 const SkImage* image) { |
| 103 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100)); | 103 SkAutoTUnref<SkData> data(image->encode(SkImageEncoder::kPNG_Type, 100)); |
| 104 if (NULL == data.get()) { | 104 if (NULL == data.get()) { |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 | 107 |
| 108 SkString filename; | 108 SkString filename; |
| 109 make_filename(name, &filename); | 109 make_filename(name, &filename); |
| 110 filename.appendf("_%s.png", config); | 110 filename.appendf("_%s.png", config); |
| 111 SkString path = SkOSPath::SkPathJoin(dir, filename.c_str()); | 111 SkString path = SkOSPath::Join(dir, filename.c_str()); |
| 112 ::remove(path.c_str()); | 112 ::remove(path.c_str()); |
| 113 | 113 |
| 114 SkFILEWStream stream(path.c_str()); | 114 SkFILEWStream stream(path.c_str()); |
| 115 stream.write(data->data(), data->size()); | 115 stream.write(data->data(), data->size()); |
| 116 } | 116 } |
| 117 | 117 |
| 118 static void perform_clip(SkCanvas* canvas, int w, int h) { | 118 static void perform_clip(SkCanvas* canvas, int w, int h) { |
| 119 SkRect r; | 119 SkRect r; |
| 120 | 120 |
| 121 r.set(SkIntToScalar(10), SkIntToScalar(10), | 121 r.set(SkIntToScalar(10), SkIntToScalar(10), |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 gContextFactory.destroyContexts(); | 707 gContextFactory.destroyContexts(); |
| 708 #endif | 708 #endif |
| 709 return 0; | 709 return 0; |
| 710 } | 710 } |
| 711 | 711 |
| 712 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 712 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 713 int main(int argc, char * const argv[]) { | 713 int main(int argc, char * const argv[]) { |
| 714 return tool_main(argc, (char**) argv); | 714 return tool_main(argc, (char**) argv); |
| 715 } | 715 } |
| 716 #endif | 716 #endif |
| OLD | NEW |