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

Side by Side Diff: cc/CCPrioritizedTextureManager.cpp

Issue 10915298: Add CCDelegatingRenderer, and corresponding IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang Created 8 years, 2 months 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/CCOcclusionTracker.cpp ('k') | cc/CCQuadCuller.cpp » ('j') | 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 "config.h" 5 #include "config.h"
6 6
7 #include "CCPrioritizedTextureManager.h" 7 #include "CCPrioritizedTextureManager.h"
8 8
9 #include "CCPrioritizedTexture.h" 9 #include "CCPrioritizedTexture.h"
10 #include "CCPriorityCalculator.h" 10 #include "CCPriorityCalculator.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // Make sure that the backings list is up to date and sorted before traversi ng it. 176 // Make sure that the backings list is up to date and sorted before traversi ng it.
177 updateBackingsPriorities(); 177 updateBackingsPriorities();
178 178
179 // Find a backing below, by either recycling or allocating. 179 // Find a backing below, by either recycling or allocating.
180 CCPrioritizedTexture::Backing* backing = 0; 180 CCPrioritizedTexture::Backing* backing = 0;
181 181
182 // First try to recycle 182 // First try to recycle
183 for (BackingSet::iterator it = m_backings.begin(); it != m_backings.end(); + +it) { 183 for (BackingSet::iterator it = m_backings.begin(); it != m_backings.end(); + +it) {
184 if ((*it)->hadOwnerAtLastPriorityUpdate() && (*it)->wasAbovePriorityCuto ffAtLastPriorityUpdate()) 184 if ((*it)->hadOwnerAtLastPriorityUpdate() && (*it)->wasAbovePriorityCuto ffAtLastPriorityUpdate())
185 break; 185 break;
186 if ((*it)->size() == texture->size() && (*it)->format() == texture->form at()) { 186 if ((*it)->size() == texture->size() && (*it)->format() == texture->form at() && !resourceProvider->inUseByConsumer((*it)->id())) {
187 backing = (*it); 187 backing = (*it);
188 break; 188 break;
189 } 189 }
190 } 190 }
191 191
192 // Otherwise reduce memory and just allocate a new backing texures. 192 // Otherwise reduce memory and just allocate a new backing texures.
193 if (!backing) { 193 if (!backing) {
194 evictBackingsToReduceMemory(m_memoryAvailableBytes - texture->bytes(), R espectManagerPriorityCutoff, resourceProvider); 194 evictBackingsToReduceMemory(m_memoryAvailableBytes - texture->bytes(), R espectManagerPriorityCutoff, resourceProvider);
195 backing = createBacking(texture->size(), texture->format(), resourceProv ider); 195 backing = createBacking(texture->size(), texture->format(), resourceProv ider);
196 } 196 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 if (reachedAboveCutoff) { 400 if (reachedAboveCutoff) {
401 ASSERT((*it)->hadOwnerAtLastPriorityUpdate() && (*it)->wasAbovePrior ityCutoffAtLastPriorityUpdate()); 401 ASSERT((*it)->hadOwnerAtLastPriorityUpdate() && (*it)->wasAbovePrior ityCutoffAtLastPriorityUpdate());
402 ASSERT(reachedOwned); 402 ASSERT(reachedOwned);
403 } 403 }
404 } 404 }
405 } 405 }
406 #endif 406 #endif
407 407
408 408
409 } // namespace cc 409 } // namespace cc
OLDNEW
« no previous file with comments | « cc/CCOcclusionTracker.cpp ('k') | cc/CCQuadCuller.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698