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 "BenchTimer.h" | 8 #include "BenchTimer.h" |
9 #include "ResultsWriter.h" | 9 #include "ResultsWriter.h" |
10 #include "SkBenchLogger.h" | 10 #include "SkBenchLogger.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 if (NULL == data.get()) { | 147 if (NULL == data.get()) { |
148 return; | 148 return; |
149 } | 149 } |
150 | 150 |
151 SkString filename; | 151 SkString filename; |
152 make_filename(name, &filename); | 152 make_filename(name, &filename); |
153 filename.appendf("_%s.png", config); | 153 filename.appendf("_%s.png", config); |
154 SkString path = SkOSPath::SkPathJoin(dir, filename.c_str()); | 154 SkString path = SkOSPath::SkPathJoin(dir, filename.c_str()); |
155 ::remove(path.c_str()); | 155 ::remove(path.c_str()); |
156 | 156 |
157 SkFILEWStream stream(filename.c_str()); | 157 SkFILEWStream stream(path.c_str()); |
158 stream.write(data->data(), data->size()); | 158 stream.write(data->data(), data->size()); |
159 } | 159 } |
160 | 160 |
161 static void performClip(SkCanvas* canvas, int w, int h) { | 161 static void performClip(SkCanvas* canvas, int w, int h) { |
162 SkRect r; | 162 SkRect r; |
163 | 163 |
164 r.set(SkIntToScalar(10), SkIntToScalar(10), | 164 r.set(SkIntToScalar(10), SkIntToScalar(10), |
165 SkIntToScalar(w*2/3), SkIntToScalar(h*2/3)); | 165 SkIntToScalar(w*2/3), SkIntToScalar(h*2/3)); |
166 canvas->clipRect(r, SkRegion::kIntersect_Op); | 166 canvas->clipRect(r, SkRegion::kIntersect_Op); |
167 | 167 |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 gContextFactory.destroyContexts(); | 717 gContextFactory.destroyContexts(); |
718 #endif | 718 #endif |
719 return 0; | 719 return 0; |
720 } | 720 } |
721 | 721 |
722 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 722 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
723 int main(int argc, char * const argv[]) { | 723 int main(int argc, char * const argv[]) { |
724 return tool_main(argc, (char**) argv); | 724 return tool_main(argc, (char**) argv); |
725 } | 725 } |
726 #endif | 726 #endif |
OLD | NEW |