| 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 /* | 8 /* |
| 9 * Code for the "gm" (Golden Master) rendering comparison tool. | 9 * Code for the "gm" (Golden Master) rendering comparison tool. |
| 10 * | 10 * |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 *bitmap.getAddr32(x, y) |= (SK_A32_MASK << SK_A32_SHIFT); | 286 *bitmap.getAddr32(x, y) |= (SK_A32_MASK << SK_A32_SHIFT); |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 static ErrorCombination write_bitmap(const SkString& path, const SkBitmap& b
itmap) { | 291 static ErrorCombination write_bitmap(const SkString& path, const SkBitmap& b
itmap) { |
| 292 // TODO(epoger): Now that we have removed force_all_opaque() | 292 // TODO(epoger): Now that we have removed force_all_opaque() |
| 293 // from this method, we should be able to get rid of the | 293 // from this method, we should be able to get rid of the |
| 294 // transformation to 8888 format also. | 294 // transformation to 8888 format also. |
| 295 SkBitmap copy; | 295 SkBitmap copy; |
| 296 bitmap.copyTo(©, SkBitmap::kARGB_8888_Config); | 296 bitmap.copyTo(©, kPMColor_SkColorType); |
| 297 if (!SkImageEncoder::EncodeFile(path.c_str(), copy, | 297 if (!SkImageEncoder::EncodeFile(path.c_str(), copy, |
| 298 SkImageEncoder::kPNG_Type, | 298 SkImageEncoder::kPNG_Type, |
| 299 100)) { | 299 100)) { |
| 300 gm_fprintf(stderr, "FAILED to write bitmap: %s\n", path.c_str()); | 300 gm_fprintf(stderr, "FAILED to write bitmap: %s\n", path.c_str()); |
| 301 return ErrorCombination(kWritingReferenceImage_ErrorType); | 301 return ErrorCombination(kWritingReferenceImage_ErrorType); |
| 302 } | 302 } |
| 303 return kEmpty_ErrorCombination; | 303 return kEmpty_ErrorCombination; |
| 304 } | 304 } |
| 305 | 305 |
| 306 /** | 306 /** |
| (...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 if (FLAGS_forceBWtext) { | 2420 if (FLAGS_forceBWtext) { |
| 2421 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2421 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 2422 } | 2422 } |
| 2423 } | 2423 } |
| 2424 | 2424 |
| 2425 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2425 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 2426 int main(int argc, char * const argv[]) { | 2426 int main(int argc, char * const argv[]) { |
| 2427 return tool_main(argc, (char**) argv); | 2427 return tool_main(argc, (char**) argv); |
| 2428 } | 2428 } |
| 2429 #endif | 2429 #endif |
| OLD | NEW |