OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 | 9 |
10 #include "GrContextFactory.h" | 10 #include "GrContextFactory.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 //////////////////////////////////////////////////////////////////////////////// | 281 //////////////////////////////////////////////////////////////////////////////// |
282 DEF_GPUTEST(ResourceCache, reporter, factory) { | 282 DEF_GPUTEST(ResourceCache, reporter, factory) { |
283 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { | 283 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { |
284 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); | 284 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); |
285 if (!GrContextFactory::IsRenderingGLContext(glType)) { | 285 if (!GrContextFactory::IsRenderingGLContext(glType)) { |
286 continue; | 286 continue; |
287 } | 287 } |
288 GrContext* context = factory->get(glType); | 288 GrContext* context = factory->get(glType, kNone_GrGLStandard); |
289 if (NULL == context) { | 289 if (NULL == context) { |
290 continue; | 290 continue; |
291 } | 291 } |
292 | 292 |
293 GrTextureDesc desc; | 293 GrTextureDesc desc; |
294 desc.fConfig = kSkia8888_GrPixelConfig; | 294 desc.fConfig = kSkia8888_GrPixelConfig; |
295 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 295 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
296 desc.fWidth = gWidth; | 296 desc.fWidth = gWidth; |
297 desc.fHeight = gHeight; | 297 desc.fHeight = gHeight; |
298 | 298 |
299 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NUL
L, 0)); | 299 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NUL
L, 0)); |
300 SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (context, textu
re.get()))); | 300 SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (context, textu
re.get()))); |
301 SkCanvas canvas(device.get()); | 301 SkCanvas canvas(device.get()); |
302 | 302 |
303 test_cache(reporter, context, &canvas); | 303 test_cache(reporter, context, &canvas); |
304 test_purge_invalidated(reporter, context); | 304 test_purge_invalidated(reporter, context); |
305 test_cache_delete_on_destruction(reporter, context); | 305 test_cache_delete_on_destruction(reporter, context); |
306 test_resource_size_changed(reporter, context); | 306 test_resource_size_changed(reporter, context); |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 #endif | 310 #endif |
OLD | NEW |