OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "CopyTilesRenderer.h" | 8 #include "CopyTilesRenderer.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkBitmapFactory.h" | 10 #include "SkBitmapFactory.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 SkDELETE(bitmap); | 156 SkDELETE(bitmap); |
157 return false; | 157 return false; |
158 } | 158 } |
159 | 159 |
160 if (FLAGS_validate) { | 160 if (FLAGS_validate) { |
161 SkBitmap* referenceBitmap = NULL; | 161 SkBitmap* referenceBitmap = NULL; |
162 sk_tools::SimplePictureRenderer referenceRenderer; | 162 sk_tools::SimplePictureRenderer referenceRenderer; |
163 success = render_picture(inputPath, NULL, referenceRenderer, | 163 success = render_picture(inputPath, NULL, referenceRenderer, |
164 &referenceBitmap); | 164 &referenceBitmap); |
165 | 165 |
166 if (!success || !referenceBitmap) { | 166 if (!success || NULL == referenceBitmap || NULL == referenceBitmap->getP
ixels()) { |
167 SkDebugf("Failed to draw the reference picture.\n"); | 167 SkDebugf("Failed to draw the reference picture.\n"); |
168 SkDELETE(bitmap); | 168 SkDELETE(bitmap); |
169 SkDELETE(referenceBitmap); | 169 SkDELETE(referenceBitmap); |
170 return false; | 170 return false; |
171 } | 171 } |
172 | 172 |
173 if (success && (bitmap->width() != referenceBitmap->width())) { | 173 if (success && (bitmap->width() != referenceBitmap->width())) { |
174 SkDebugf("Expected image width: %i, actual image width %i.\n", | 174 SkDebugf("Expected image width: %i, actual image width %i.\n", |
175 referenceBitmap->width(), bitmap->width()); | 175 referenceBitmap->width(), bitmap->width()); |
176 SkDELETE(bitmap); | 176 SkDELETE(bitmap); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 #endif | 323 #endif |
324 #endif | 324 #endif |
325 return 0; | 325 return 0; |
326 } | 326 } |
327 | 327 |
328 #if !defined SK_BUILD_FOR_IOS | 328 #if !defined SK_BUILD_FOR_IOS |
329 int main(int argc, char * const argv[]) { | 329 int main(int argc, char * const argv[]) { |
330 return tool_main(argc, (char**) argv); | 330 return tool_main(argc, (char**) argv); |
331 } | 331 } |
332 #endif | 332 #endif |
OLD | NEW |