Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: gm/gmmain.cpp

Issue 704413002: Cleanup: Use SkAutoGraphics in gm and tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/skia_test.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2239 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 usage.printf("Run the golden master tests.\n"); 2250 usage.printf("Run the golden master tests.\n");
2251 SkCommandLineFlags::SetUsage(usage.c_str()); 2251 SkCommandLineFlags::SetUsage(usage.c_str());
2252 SkCommandLineFlags::Parse(argc, argv); 2252 SkCommandLineFlags::Parse(argc, argv);
2253 2253
2254 #if SK_ENABLE_INST_COUNT 2254 #if SK_ENABLE_INST_COUNT
2255 if (FLAGS_leaks) { 2255 if (FLAGS_leaks) {
2256 gPrintInstCount = true; 2256 gPrintInstCount = true;
2257 } 2257 }
2258 #endif 2258 #endif
2259 2259
2260 SkGraphics::Init(); 2260 SkAutoGraphics ag;
2261 2261
2262 setSystemPreferences(); 2262 setSystemPreferences();
2263 GMMain gmmain; 2263 GMMain gmmain;
2264 2264
2265 SkTDArray<size_t> configs; 2265 SkTDArray<size_t> configs;
2266 2266
2267 int moduloRemainder = -1; 2267 int moduloRemainder = -1;
2268 int moduloDivisor = -1; 2268 int moduloDivisor = -1;
2269 SkTDArray<const PDFRasterizerData*> pdfRasterizers; 2269 SkTDArray<const PDFRasterizerData*> pdfRasterizers;
2270 SkTDArray<SkScalar> tileGridReplayScales; 2270 SkTDArray<SkScalar> tileGridReplayScales;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 if (kGPU_Backend == config.fBackend) { 2467 if (kGPU_Backend == config.fBackend) {
2468 GrContext* gr = grFactory->get(config.fGLContextType, gpuAPI); 2468 GrContext* gr = grFactory->get(config.fGLContextType, gpuAPI);
2469 2469
2470 gr->dumpFontCache(); 2470 gr->dumpFontCache();
2471 } 2471 }
2472 } 2472 }
2473 #endif 2473 #endif
2474 2474
2475 delete grFactory; 2475 delete grFactory;
2476 #endif 2476 #endif
2477 SkGraphics::Term();
2478 2477
2479 return (reportError) ? -1 : 0; 2478 return (reportError) ? -1 : 0;
2480 } 2479 }
2481 2480
2482 void GMMain::installFilter(SkCanvas* canvas) { 2481 void GMMain::installFilter(SkCanvas* canvas) {
2483 if (FLAGS_forceBWtext) { 2482 if (FLAGS_forceBWtext) {
2484 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); 2483 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref();
2485 } 2484 }
2486 } 2485 }
2487 2486
2488 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 2487 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
2489 int main(int argc, char * const argv[]) { 2488 int main(int argc, char * const argv[]) {
2490 return tool_main(argc, (char**) argv); 2489 return tool_main(argc, (char**) argv);
2491 } 2490 }
2492 #endif 2491 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/skia_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698