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