| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "SkCanvas.h" | 5 #include "SkCanvas.h" |
| 6 #include "SkFlattenableSerialization.h" | 6 #include "SkFlattenableSerialization.h" |
| 7 #include "SkImageFilter.h" | 7 #include "SkImageFilter.h" |
| 8 #include "SkOSFile.h" | 8 #include "SkOSFile.h" |
| 9 #include "SkString.h" | 9 #include "SkString.h" |
| 10 | 10 |
| 11 static const int kBitmapSize = 24; | 11 static const int kBitmapSize = 24; |
| 12 | 12 |
| 13 static bool read_test_case(const char* filename, SkString* testdata) { | 13 static bool read_test_case(const char* filename, SkString* testdata) { |
| 14 SkFILE* file = sk_fopen(filename, kRead_SkFILE_Flag); | 14 FILE* file = sk_fopen(filename, kRead_SkFILE_Flag); |
| 15 if (!file) { | 15 if (!file) { |
| 16 SkDebugf("couldn't open file %s\n", filename); | 16 SkDebugf("couldn't open file %s\n", filename); |
| 17 return false; | 17 return false; |
| 18 } | 18 } |
| 19 size_t len = sk_fgetsize(file); | 19 size_t len = sk_fgetsize(file); |
| 20 if (!len) { | 20 if (!len) { |
| 21 SkDebugf("couldn't read file %s\n", filename); | 21 SkDebugf("couldn't read file %s\n", filename); |
| 22 return false; | 22 return false; |
| 23 } | 23 } |
| 24 testdata->resize(len); | 24 testdata->resize(len); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 canvas.clear(0x00000000); | 73 canvas.clear(0x00000000); |
| 74 for (int i = 1; i < argc; i++) | 74 for (int i = 1; i < argc; i++) |
| 75 if (!read_and_run_test_case(argv[i], bitmap, &canvas)) | 75 if (!read_and_run_test_case(argv[i], bitmap, &canvas)) |
| 76 ret = 2; | 76 ret = 2; |
| 77 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish | 77 // Cluster-Fuzz likes "#EOF" as the last line of output to help distinguish |
| 78 // successful runs from crashes. | 78 // successful runs from crashes. |
| 79 SkDebugf("#EOF\n"); | 79 SkDebugf("#EOF\n"); |
| 80 return ret; | 80 return ret; |
| 81 } | 81 } |
| 82 | 82 |
| OLD | NEW |