Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: cc/nine_patch_layer_unittest.cc

Issue 11420021: Handle NinePatchLayer Resource Rebuilding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/nine_patch_layer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/nine_patch_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698