| 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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 errors.add(compare_to_expectations(expectations, actualBitmapAndDigest,
shortName, | 1004 errors.add(compare_to_expectations(expectations, actualBitmapAndDigest,
shortName, |
| 1005 configName, renderModeDescriptor, fal
se)); | 1005 configName, renderModeDescriptor, fal
se)); |
| 1006 SkString shortNamePlusConfig = make_shortname_plus_config(shortName, con
figName); | 1006 SkString shortNamePlusConfig = make_shortname_plus_config(shortName, con
figName); |
| 1007 RecordTestResults(errors, shortNamePlusConfig, renderModeDescriptor); | 1007 RecordTestResults(errors, shortNamePlusConfig, renderModeDescriptor); |
| 1008 | 1008 |
| 1009 return errors; | 1009 return errors; |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 static SkPicture* generate_new_picture(GM* gm, BbhType bbhType, uint32_t rec
ordFlags, | 1012 static SkPicture* generate_new_picture(GM* gm, BbhType bbhType, uint32_t rec
ordFlags, |
| 1013 SkScalar scale = SK_Scalar1) { | 1013 SkScalar scale = SK_Scalar1) { |
| 1014 int width = SkScalarCeilToInt(SkScalarMul(SkIntToScalar(gm->getISize().w
idth()), scale)); | 1014 SkScalar width = SkScalarMul(SkIntToScalar(gm->getISize().width()), scal
e); |
| 1015 int height = SkScalarCeilToInt(SkScalarMul(SkIntToScalar(gm->getISize().
height()), scale)); | 1015 SkScalar height = SkScalarMul(SkIntToScalar(gm->getISize().height()), sc
ale); |
| 1016 | 1016 |
| 1017 SkAutoTDelete<SkBBHFactory> factory; | 1017 SkAutoTDelete<SkBBHFactory> factory; |
| 1018 if (kTileGrid_BbhType == bbhType) { | 1018 if (kTileGrid_BbhType == bbhType) { |
| 1019 SkTileGridFactory::TileGridInfo info; | 1019 SkTileGridFactory::TileGridInfo info; |
| 1020 info.fMargin.setEmpty(); | 1020 info.fMargin.setEmpty(); |
| 1021 info.fOffset.setZero(); | 1021 info.fOffset.setZero(); |
| 1022 info.fTileInterval.set(16, 16); | 1022 info.fTileInterval.set(16, 16); |
| 1023 factory.reset(SkNEW_ARGS(SkTileGridFactory, (info))); | 1023 factory.reset(SkNEW_ARGS(SkTileGridFactory, (info))); |
| 1024 } else if (kRTree_BbhType == bbhType) { | 1024 } else if (kRTree_BbhType == bbhType) { |
| 1025 factory.reset(SkNEW(SkRTreeFactory)); | 1025 factory.reset(SkNEW(SkRTreeFactory)); |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2479 if (FLAGS_forceBWtext) { | 2479 if (FLAGS_forceBWtext) { |
| 2480 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2480 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 2481 } | 2481 } |
| 2482 } | 2482 } |
| 2483 | 2483 |
| 2484 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2484 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 2485 int main(int argc, char * const argv[]) { | 2485 int main(int argc, char * const argv[]) { |
| 2486 return tool_main(argc, (char**) argv); | 2486 return tool_main(argc, (char**) argv); |
| 2487 } | 2487 } |
| 2488 #endif | 2488 #endif |
| OLD | NEW |