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

Side by Side Diff: cc/prioritized_texture_manager.cc

Issue 11150025: Patch from https://codereview.chromium.org/11111005/ without actual file deletes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/prioritized_texture_manager.h ('k') | cc/prioritized_texture_unittest.cc » ('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 "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "CCPrioritizedTexture.h" 10 #include "CCPrioritizedTexture.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 texture->setAbovePriorityCutoff(false); 343 texture->setAbovePriorityCutoff(false);
344 } 344 }
345 345
346 void CCPrioritizedTextureManager::returnBackingTexture(CCPrioritizedTexture* tex ture) 346 void CCPrioritizedTextureManager::returnBackingTexture(CCPrioritizedTexture* tex ture)
347 { 347 {
348 ASSERT(CCProxy::isMainThread() || (CCProxy::isImplThread() && CCProxy::isMai nThreadBlocked())); 348 ASSERT(CCProxy::isMainThread() || (CCProxy::isImplThread() && CCProxy::isMai nThreadBlocked()));
349 if (texture->backing()) 349 if (texture->backing())
350 texture->unlink(); 350 texture->unlink();
351 } 351 }
352 352
353 CCPrioritizedTexture::Backing* CCPrioritizedTextureManager::createBacking(IntSiz e size, GC3Denum format, CCResourceProvider* resourceProvider) 353 CCPrioritizedTexture::Backing* CCPrioritizedTextureManager::createBacking(IntSiz e size, GLenum format, CCResourceProvider* resourceProvider)
354 { 354 {
355 ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked()); 355 ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked());
356 ASSERT(resourceProvider); 356 ASSERT(resourceProvider);
357 CCResourceProvider::ResourceId resourceId = resourceProvider->createResource (m_pool, size, format, CCResourceProvider::TextureUsageAny); 357 CCResourceProvider::ResourceId resourceId = resourceProvider->createResource (m_pool, size, format, CCResourceProvider::TextureUsageAny);
358 CCPrioritizedTexture::Backing* backing = new CCPrioritizedTexture::Backing(r esourceId, resourceProvider, size, format); 358 CCPrioritizedTexture::Backing* backing = new CCPrioritizedTexture::Backing(r esourceId, resourceProvider, size, format);
359 m_memoryUseBytes += backing->bytes(); 359 m_memoryUseBytes += backing->bytes();
360 // Put backing texture at the front for eviction, since it isn't in use yet. 360 // Put backing texture at the front for eviction, since it isn't in use yet.
361 m_backings.insertBefore(m_backings.begin(), backing); 361 m_backings.insertBefore(m_backings.begin(), backing);
362 return backing; 362 return backing;
363 } 363 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 if (reachedUnrecyclable) 420 if (reachedUnrecyclable)
421 ASSERT(!(*it)->canBeRecycled()); 421 ASSERT(!(*it)->canBeRecycled());
422 else 422 else
423 ASSERT((*it)->canBeRecycled()); 423 ASSERT((*it)->canBeRecycled());
424 } 424 }
425 } 425 }
426 #endif 426 #endif
427 427
428 428
429 } // namespace cc 429 } // namespace cc
OLDNEW
« no previous file with comments | « cc/prioritized_texture_manager.h ('k') | cc/prioritized_texture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698