OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 uint32_t flags = 0; | 59 uint32_t flags = 0; |
60 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 60 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
61 | 61 |
62 // configure our context for maximum stressing of cache and atlas | 62 // configure our context for maximum stressing of cache and atlas |
63 if (stressTest) { | 63 if (stressTest) { |
64 GrTest::SetupAlwaysEvictAtlas(context); | 64 GrTest::SetupAlwaysEvictAtlas(context); |
65 context->setTextBlobCacheLimit_ForTesting(0); | 65 context->setTextBlobCacheLimit_ForTesting(0); |
66 } | 66 } |
67 | 67 |
68 SkImageInfo info = SkImageInfo::Make(kWidth, kHeight, kN32_SkColorType, kPre
mul_SkAlphaType); | 68 SkImageInfo info = SkImageInfo::Make(kWidth, kHeight, kN32_SkColorType, kPre
mul_SkAlphaType); |
69 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, SkSurfac
e::kNo_Budgeted, info, | 69 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, SkBudget
ed::kNo, info, |
70 0, &props)); | 70 0, &props)); |
71 REPORTER_ASSERT(reporter, surface); | 71 REPORTER_ASSERT(reporter, surface); |
72 if (!surface) { | 72 if (!surface) { |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 SkCanvas* canvas = surface->getCanvas(); | 76 SkCanvas* canvas = surface->getCanvas(); |
77 | 77 |
78 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault()); | 78 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault()); |
79 | 79 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 166 } |
167 | 167 |
168 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobAbnormal, reporter, context) { | 168 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobAbnormal, reporter, context) { |
169 text_blob_cache_inner(reporter, context, 256, 256, 10, false, false); | 169 text_blob_cache_inner(reporter, context, 256, 256, 10, false, false); |
170 } | 170 } |
171 | 171 |
172 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobStressAbnormal, reporter, context) { | 172 DEF_GPUTEST_FOR_NULL_CONTEXT(TextBlobStressAbnormal, reporter, context) { |
173 text_blob_cache_inner(reporter, context, 256, 256, 10, false, true); | 173 text_blob_cache_inner(reporter, context, 256, 256, 10, false, true); |
174 } | 174 } |
175 #endif | 175 #endif |
OLD | NEW |