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 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 #if SK_SUPPORT_GPU | 1752 #if SK_SUPPORT_GPU |
1753 SkAutoTUnref<GrSurface> auGpuTarget; | 1753 SkAutoTUnref<GrSurface> auGpuTarget; |
1754 if ((errorsForThisConfig.isEmpty()) && (kGPU_Backend == config.fBackend)
) { | 1754 if ((errorsForThisConfig.isEmpty()) && (kGPU_Backend == config.fBackend)
) { |
1755 if (FLAGS_resetGpuContext) { | 1755 if (FLAGS_resetGpuContext) { |
1756 grFactory->destroyContexts(); | 1756 grFactory->destroyContexts(); |
1757 } | 1757 } |
1758 GrContext* gr = grFactory->get(config.fGLContextType, gpuAPI); | 1758 GrContext* gr = grFactory->get(config.fGLContextType, gpuAPI); |
1759 bool grSuccess = false; | 1759 bool grSuccess = false; |
1760 if (gr) { | 1760 if (gr) { |
1761 // create a render target to back the device | 1761 // create a render target to back the device |
1762 GrTextureDesc desc; | 1762 GrSurfaceDesc desc; |
1763 desc.fConfig = kSkia8888_GrPixelConfig; | 1763 desc.fConfig = kSkia8888_GrPixelConfig; |
1764 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 1764 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
1765 desc.fWidth = gm->getISize().width(); | 1765 desc.fWidth = gm->getISize().width(); |
1766 desc.fHeight = gm->getISize().height(); | 1766 desc.fHeight = gm->getISize().height(); |
1767 desc.fSampleCnt = config.fSampleCnt; | 1767 desc.fSampleCnt = config.fSampleCnt; |
1768 auGpuTarget.reset(gr->createUncachedTexture(desc, NULL, 0)); | 1768 auGpuTarget.reset(gr->createUncachedTexture(desc, NULL, 0)); |
1769 if (auGpuTarget) { | 1769 if (auGpuTarget) { |
1770 gpuTarget = auGpuTarget; | 1770 gpuTarget = auGpuTarget; |
1771 grSuccess = true; | 1771 grSuccess = true; |
1772 // Set the user specified cache limits if non-default. | 1772 // Set the user specified cache limits if non-default. |
1773 size_t bytes; | 1773 size_t bytes; |
1774 int count; | 1774 int count; |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 if (FLAGS_forceBWtext) { | 2483 if (FLAGS_forceBWtext) { |
2484 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2484 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2485 } | 2485 } |
2486 } | 2486 } |
2487 | 2487 |
2488 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2488 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2489 int main(int argc, char * const argv[]) { | 2489 int main(int argc, char * const argv[]) { |
2490 return tool_main(argc, (char**) argv); | 2490 return tool_main(argc, (char**) argv); |
2491 } | 2491 } |
2492 #endif | 2492 #endif |
OLD | NEW |