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

Side by Side Diff: cc/resources/prioritized_resource_manager.cc

Issue 946243002: Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix git cl upload to include ots Created 5 years, 10 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
« no previous file with comments | « cc/resources/platform_color_unittest.cc ('k') | cc/resources/raster_source.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/resources/prioritized_resource_manager.h" 5 #include "cc/resources/prioritized_resource_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/resources/prioritized_resource.h" 10 #include "cc/resources/prioritized_resource.h"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 } 444 }
445 445
446 PrioritizedResource::Backing* PrioritizedResourceManager::CreateBacking( 446 PrioritizedResource::Backing* PrioritizedResourceManager::CreateBacking(
447 const gfx::Size& size, 447 const gfx::Size& size,
448 ResourceFormat format, 448 ResourceFormat format,
449 ResourceProvider* resource_provider) { 449 ResourceProvider* resource_provider) {
450 DCHECK(proxy_->IsImplThread() && proxy_->IsMainThreadBlocked()); 450 DCHECK(proxy_->IsImplThread() && proxy_->IsMainThreadBlocked());
451 DCHECK(resource_provider); 451 DCHECK(resource_provider);
452 ResourceProvider::ResourceId resource_id = 452 ResourceProvider::ResourceId resource_id =
453 resource_provider->CreateManagedResource( 453 resource_provider->CreateManagedResource(
454 size, 454 size, GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
455 GL_TEXTURE_2D, 455 ResourceProvider::TEXTURE_HINT_IMMUTABLE, format);
456 GL_CLAMP_TO_EDGE,
457 ResourceProvider::TextureHintImmutable,
458 format);
459 PrioritizedResource::Backing* backing = new PrioritizedResource::Backing( 456 PrioritizedResource::Backing* backing = new PrioritizedResource::Backing(
460 resource_id, resource_provider, size, format); 457 resource_id, resource_provider, size, format);
461 memory_use_bytes_ += backing->bytes(); 458 memory_use_bytes_ += backing->bytes();
462 return backing; 459 return backing;
463 } 460 }
464 461
465 void PrioritizedResourceManager::EvictFirstBackingResource( 462 void PrioritizedResourceManager::EvictFirstBackingResource(
466 ResourceProvider* resource_provider) { 463 ResourceProvider* resource_provider) {
467 DCHECK(proxy_->IsImplThread()); 464 DCHECK(proxy_->IsImplThread());
468 DCHECK(resource_provider); 465 DCHECK(resource_provider);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 previous_backing = backing; 538 previous_backing = backing;
542 } 539 }
543 #endif // DCHECK_IS_ON() 540 #endif // DCHECK_IS_ON()
544 } 541 }
545 542
546 const Proxy* PrioritizedResourceManager::ProxyForDebug() const { 543 const Proxy* PrioritizedResourceManager::ProxyForDebug() const {
547 return proxy_; 544 return proxy_;
548 } 545 }
549 546
550 } // namespace cc 547 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/platform_color_unittest.cc ('k') | cc/resources/raster_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698