Chromium Code Reviews| 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 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1584 if (i > 0) { | 1584 if (i > 0) { |
| 1585 total.append(", "); | 1585 total.append(", "); |
| 1586 } | 1586 } |
| 1587 total.append("\""); | 1587 total.append("\""); |
| 1588 total.append(gRec[configs[i]].fName); | 1588 total.append(gRec[configs[i]].fName); |
| 1589 total.append("\""); | 1589 total.append("\""); |
| 1590 } | 1590 } |
| 1591 return total; | 1591 return total; |
| 1592 } | 1592 } |
| 1593 | 1593 |
| 1594 #include "SkTime.h" | |
|
epoger
2013/04/22 19:53:28
You're gonna want to revert all changes to this fi
bungeman-skia
2013/04/22 20:08:00
Yes, I just wanted to have this here so it cold be
| |
| 1595 | |
| 1594 int tool_main(int argc, char** argv); | 1596 int tool_main(int argc, char** argv); |
| 1595 int tool_main(int argc, char** argv) { | 1597 int tool_main(int argc, char** argv) { |
| 1596 | 1598 |
| 1597 #if SK_ENABLE_INST_COUNT | 1599 #if SK_ENABLE_INST_COUNT |
| 1598 gPrintInstCount = true; | 1600 gPrintInstCount = true; |
| 1599 #endif | 1601 #endif |
| 1600 | 1602 |
| 1603 SkMSec startTime = SkTime::GetMSecs(); | |
| 1604 | |
| 1601 SkGraphics::Init(); | 1605 SkGraphics::Init(); |
| 1602 // we don't need to see this during a run | 1606 // we don't need to see this during a run |
| 1603 gSkSuppressFontCachePurgeSpew = true; | 1607 gSkSuppressFontCachePurgeSpew = true; |
| 1604 | 1608 |
| 1605 setSystemPreferences(); | 1609 setSystemPreferences(); |
| 1606 GMMain gmmain; | 1610 GMMain gmmain; |
| 1607 | 1611 |
| 1608 SkTDArray<size_t> configs; | 1612 SkTDArray<size_t> configs; |
| 1609 SkTDArray<size_t> excludeConfigs; | 1613 SkTDArray<size_t> excludeConfigs; |
| 1610 bool userConfig = false; | 1614 bool userConfig = false; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1839 } | 1843 } |
| 1840 | 1844 |
| 1841 SkTArray<SkString> modes; | 1845 SkTArray<SkString> modes; |
| 1842 gmmain.GetRenderModesEncountered(modes); | 1846 gmmain.GetRenderModesEncountered(modes); |
| 1843 bool reportError = false; | 1847 bool reportError = false; |
| 1844 if (gmmain.NumSignificantErrors() > 0) { | 1848 if (gmmain.NumSignificantErrors() > 0) { |
| 1845 reportError = true; | 1849 reportError = true; |
| 1846 } | 1850 } |
| 1847 int expectedNumberOfTests = gmsRun * (configs.count() + modes.count()); | 1851 int expectedNumberOfTests = gmsRun * (configs.count() + modes.count()); |
| 1848 | 1852 |
| 1853 SkMSec middleTime = SkTime::GetMSecs(); | |
| 1854 | |
| 1849 // Output summary to stdout. | 1855 // Output summary to stdout. |
| 1850 if (FLAGS_verbose) { | 1856 if (FLAGS_verbose) { |
| 1851 gm_fprintf(stdout, "Ran %d GMs\n", gmsRun); | 1857 gm_fprintf(stdout, "Ran %d GMs\n", gmsRun); |
| 1852 gm_fprintf(stdout, "... over %2d configs [%s]\n", configs.count(), | 1858 gm_fprintf(stdout, "... over %2d configs [%s]\n", configs.count(), |
| 1853 list_all_config_names(configs).c_str()); | 1859 list_all_config_names(configs).c_str()); |
| 1854 gm_fprintf(stdout, "... and %2d modes [%s]\n", modes.count(), list_al l(modes).c_str()); | 1860 gm_fprintf(stdout, "... and %2d modes [%s]\n", modes.count(), list_al l(modes).c_str()); |
| 1855 gm_fprintf(stdout, "... so there should be a total of %d tests.\n", expe ctedNumberOfTests); | 1861 gm_fprintf(stdout, "... so there should be a total of %d tests.\n", expe ctedNumberOfTests); |
| 1856 } | 1862 } |
| 1857 gmmain.ListErrors(FLAGS_verbose); | 1863 gmmain.ListErrors(FLAGS_verbose); |
| 1858 | 1864 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1897 gm_fprintf(stdout, "config: %s %x\n", config.fName, gr); | 1903 gm_fprintf(stdout, "config: %s %x\n", config.fName, gr); |
| 1898 gr->printCacheStats(); | 1904 gr->printCacheStats(); |
| 1899 } | 1905 } |
| 1900 } | 1906 } |
| 1901 #endif | 1907 #endif |
| 1902 | 1908 |
| 1903 delete grFactory; | 1909 delete grFactory; |
| 1904 #endif | 1910 #endif |
| 1905 SkGraphics::Term(); | 1911 SkGraphics::Term(); |
| 1906 | 1912 |
| 1913 SkMSec endTime = SkTime::GetMSecs(); | |
| 1914 printf("EPOGER timings: start-middle=%d msecs, start-end=%d msecs\n", | |
| 1915 (middleTime - startTime), (endTime - startTime)); | |
| 1916 | |
| 1907 return (reportError) ? -1 : 0; | 1917 return (reportError) ? -1 : 0; |
| 1908 } | 1918 } |
| 1909 | 1919 |
| 1910 void GMMain::installFilter(SkCanvas* canvas) { | 1920 void GMMain::installFilter(SkCanvas* canvas) { |
| 1911 if (FLAGS_forceBWtext) { | 1921 if (FLAGS_forceBWtext) { |
| 1912 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 1922 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 1913 } | 1923 } |
| 1914 } | 1924 } |
| 1915 | 1925 |
| 1916 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 1926 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 1917 int main(int argc, char * const argv[]) { | 1927 int main(int argc, char * const argv[]) { |
| 1918 return tool_main(argc, (char**) argv); | 1928 return tool_main(argc, (char**) argv); |
| 1919 } | 1929 } |
| 1920 #endif | 1930 #endif |
| OLD | NEW |