| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 cache->addUse(layer); | 87 cache->addUse(layer); |
| 88 | 88 |
| 89 REPORTER_ASSERT(reporter, 1 == TestingAccess::Uses(layer)); | 89 REPORTER_ASSERT(reporter, 1 == TestingAccess::Uses(layer)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // This test case exercises the public API of the GrLayerCache class. | 92 // This test case exercises the public API of the GrLayerCache class. |
| 93 // In particular it checks its interaction with the resource cache (w.r.t. | 93 // In particular it checks its interaction with the resource cache (w.r.t. |
| 94 // locking & unlocking textures). | 94 // locking & unlocking textures). |
| 95 // TODO: need to add checks on VRAM usage! | 95 // TODO: need to add checks on VRAM usage! |
| 96 DEF_GPUTEST(GpuLayerCache, reporter, factory) { | 96 DEF_GPUTEST(GpuLayerCache, reporter, factory) { |
| 97 static const int kInitialNumLayers = 5; | 97 static const unsigned kInitialNumLayers = 5; |
| 98 | 98 |
| 99 for (int i= 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { | 99 for (int i= 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { |
| 100 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type) i; | 100 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type) i; |
| 101 | 101 |
| 102 if (!GrContextFactory::IsRenderingGLContext(glCtxType)) { | 102 if (!GrContextFactory::IsRenderingGLContext(glCtxType)) { |
| 103 continue; | 103 continue; |
| 104 } | 104 } |
| 105 | 105 |
| 106 GrContext* context = factory->get(glCtxType); | 106 GrContext* context = factory->get(glCtxType); |
| 107 | 107 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 picture.reset(NULL); | 241 picture.reset(NULL); |
| 242 cache.processDeletedPictures(); | 242 cache.processDeletedPictures(); |
| 243 | 243 |
| 244 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); | 244 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); |
| 245 // TODO: add VRAM/resource cache check here | 245 // TODO: add VRAM/resource cache check here |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 #endif | 249 #endif |
| OLD | NEW |