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 28 matching lines...) Expand all Loading... |
39 #include "SkStream.h" | 39 #include "SkStream.h" |
40 #include "SkString.h" | 40 #include "SkString.h" |
41 #include "SkSurface.h" | 41 #include "SkSurface.h" |
42 #include "SkTArray.h" | 42 #include "SkTArray.h" |
43 #include "SkTDict.h" | 43 #include "SkTDict.h" |
44 #include "SkTileGridPicture.h" | 44 #include "SkTileGridPicture.h" |
45 #include "SamplePipeControllers.h" | 45 #include "SamplePipeControllers.h" |
46 | 46 |
47 #ifdef SK_DEBUG | 47 #ifdef SK_DEBUG |
48 static const bool kDebugOnly = true; | 48 static const bool kDebugOnly = true; |
| 49 #define GR_DUMP_FONT_CACHE 0 |
49 #else | 50 #else |
50 static const bool kDebugOnly = false; | 51 static const bool kDebugOnly = false; |
51 #endif | 52 #endif |
52 | 53 |
53 __SK_FORCE_IMAGE_DECODER_LINKING; | 54 __SK_FORCE_IMAGE_DECODER_LINKING; |
54 | 55 |
55 #if SK_SUPPORT_GPU | 56 #if SK_SUPPORT_GPU |
56 #include "GrContextFactory.h" | 57 #include "GrContextFactory.h" |
57 #include "SkGpuDevice.h" | 58 #include "SkGpuDevice.h" |
58 typedef GrContextFactory::GLContextType GLContextType; | 59 typedef GrContextFactory::GLContextType GLContextType; |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 | 2402 |
2402 if (FLAGS_verbose && (kGPU_Backend == config.fBackend)) { | 2403 if (FLAGS_verbose && (kGPU_Backend == config.fBackend)) { |
2403 GrContext* gr = grFactory->get(config.fGLContextType); | 2404 GrContext* gr = grFactory->get(config.fGLContextType); |
2404 | 2405 |
2405 SkDebugf("config: %s %x\n", config.fName, gr); | 2406 SkDebugf("config: %s %x\n", config.fName, gr); |
2406 gr->printCacheStats(); | 2407 gr->printCacheStats(); |
2407 } | 2408 } |
2408 } | 2409 } |
2409 #endif | 2410 #endif |
2410 | 2411 |
| 2412 #if GR_DUMP_FONT_CACHE |
| 2413 for (int i = 0; i < configs.count(); i++) { |
| 2414 ConfigData config = gRec[configs[i]]; |
| 2415 |
| 2416 if (kGPU_Backend == config.fBackend) { |
| 2417 GrContext* gr = grFactory->get(config.fGLContextType); |
| 2418 |
| 2419 gr->dumpFontCache(); |
| 2420 } |
| 2421 } |
| 2422 #endif |
| 2423 |
2411 delete grFactory; | 2424 delete grFactory; |
2412 #endif | 2425 #endif |
2413 SkGraphics::Term(); | 2426 SkGraphics::Term(); |
2414 | 2427 |
2415 return (reportError) ? -1 : 0; | 2428 return (reportError) ? -1 : 0; |
2416 } | 2429 } |
2417 | 2430 |
2418 void GMMain::installFilter(SkCanvas* canvas) { | 2431 void GMMain::installFilter(SkCanvas* canvas) { |
2419 if (FLAGS_forceBWtext) { | 2432 if (FLAGS_forceBWtext) { |
2420 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2433 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2421 } | 2434 } |
2422 } | 2435 } |
2423 | 2436 |
2424 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2437 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2425 int main(int argc, char * const argv[]) { | 2438 int main(int argc, char * const argv[]) { |
2426 return tool_main(argc, (char**) argv); | 2439 return tool_main(argc, (char**) argv); |
2427 } | 2440 } |
2428 #endif | 2441 #endif |
OLD | NEW |