OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/nine_patch_layer.h" | 5 #include "cc/nine_patch_layer.h" |
6 | 6 |
7 #include "cc/layer_tree_host.h" | 7 #include "cc/layer_tree_host.h" |
8 #include "cc/occlusion_tracker.h" | 8 #include "cc/occlusion_tracker.h" |
9 #include "cc/overdraw_metrics.h" | 9 #include "cc/overdraw_metrics.h" |
10 #include "cc/rendering_stats.h" | 10 #include "cc/rendering_stats.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 DebugScopedSetImplThread implThread(proxy()); | 124 DebugScopedSetImplThread implThread(proxy()); |
125 DebugScopedSetMainThreadBlocked mainThreadBlocked(proxy()); | 125 DebugScopedSetMainThreadBlocked mainThreadBlocked(proxy()); |
126 m_layerTreeHost->contentsTextureManager()->clearAllMemory(resourceProvid
er.get()); | 126 m_layerTreeHost->contentsTextureManager()->clearAllMemory(resourceProvid
er.get()); |
127 } | 127 } |
128 | 128 |
129 // Reupload after eviction | 129 // Reupload after eviction |
130 testLayer->setTexturePriorities(calculator); | 130 testLayer->setTexturePriorities(calculator); |
131 testLayer->update(queue, &occlusionTracker, stats); | 131 testLayer->update(queue, &occlusionTracker, stats); |
132 EXPECT_EQ(queue.fullUploadSize(), 1); | 132 EXPECT_EQ(queue.fullUploadSize(), 1); |
133 EXPECT_EQ(queue.partialUploadSize(), 0); | 133 EXPECT_EQ(queue.partialUploadSize(), 0); |
| 134 |
| 135 // PrioritizedResourceManager clearing |
| 136 m_layerTreeHost->contentsTextureManager()->unregisterTexture(params.texture)
; |
| 137 EXPECT_EQ(NULL, params.texture->resourceManager()); |
| 138 testLayer->setTexturePriorities(calculator); |
| 139 ResourceUpdateQueue queue2; |
| 140 testLayer->update(queue2, &occlusionTracker, stats); |
| 141 EXPECT_EQ(queue2.fullUploadSize(), 1); |
| 142 EXPECT_EQ(queue2.partialUploadSize(), 0); |
| 143 params = queue2.takeFirstFullUpload(); |
| 144 EXPECT_TRUE(params.texture != NULL); |
| 145 EXPECT_EQ(params.texture->resourceManager(), m_layerTreeHost->contentsTextur
eManager()); |
134 } | 146 } |
135 | 147 |
136 } // namespace | 148 } // namespace |
137 } // namespace cc | 149 } // namespace cc |
OLD | NEW |