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

Side by Side Diff: cc/prioritized_resource_manager.cc

Issue 11548052: Identify evictable textures by GL texture parameter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve against head again Created 8 years 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 | « no previous file | cc/resource_provider.h » ('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 "cc/prioritized_resource_manager.h" 5 #include "cc/prioritized_resource_manager.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "cc/prioritized_resource.h" 9 #include "cc/prioritized_resource.h"
10 #include "cc/priority_calculator.h" 10 #include "cc/priority_calculator.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 { 388 {
389 DCHECK(m_proxy->isMainThread() || (m_proxy->isImplThread() && m_proxy->isMai nThreadBlocked())); 389 DCHECK(m_proxy->isMainThread() || (m_proxy->isImplThread() && m_proxy->isMai nThreadBlocked()));
390 if (texture->backing()) 390 if (texture->backing())
391 texture->unlink(); 391 texture->unlink();
392 } 392 }
393 393
394 PrioritizedResource::Backing* PrioritizedResourceManager::createBacking(gfx::Siz e size, GLenum format, ResourceProvider* resourceProvider) 394 PrioritizedResource::Backing* PrioritizedResourceManager::createBacking(gfx::Siz e size, GLenum format, ResourceProvider* resourceProvider)
395 { 395 {
396 DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); 396 DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked());
397 DCHECK(resourceProvider); 397 DCHECK(resourceProvider);
398 ResourceProvider::ResourceId resourceId = resourceProvider->createResource(s ize, format, ResourceProvider::TextureUsageAny); 398 ResourceProvider::ResourceId resourceId = resourceProvider->createManagedRes ource(size, format, ResourceProvider::TextureUsageAny);
399 PrioritizedResource::Backing* backing = new PrioritizedResource::Backing(res ourceId, resourceProvider, size, format); 399 PrioritizedResource::Backing* backing = new PrioritizedResource::Backing(res ourceId, resourceProvider, size, format);
400 m_memoryUseBytes += backing->bytes(); 400 m_memoryUseBytes += backing->bytes();
401 return backing; 401 return backing;
402 } 402 }
403 403
404 void PrioritizedResourceManager::evictFirstBackingResource(ResourceProvider* res ourceProvider) 404 void PrioritizedResourceManager::evictFirstBackingResource(ResourceProvider* res ourceProvider)
405 { 405 {
406 DCHECK(m_proxy->isImplThread()); 406 DCHECK(m_proxy->isImplThread());
407 DCHECK(resourceProvider); 407 DCHECK(resourceProvider);
408 DCHECK(!m_backings.empty()); 408 DCHECK(!m_backings.empty());
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 } 470 }
471 #endif 471 #endif
472 } 472 }
473 473
474 const Proxy* PrioritizedResourceManager::proxyForDebug() const 474 const Proxy* PrioritizedResourceManager::proxyForDebug() const
475 { 475 {
476 return m_proxy; 476 return m_proxy;
477 } 477 }
478 478
479 } // namespace cc 479 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698