OLD | NEW |
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/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 itr != resources_.end(); ++itr) { | 369 itr != resources_.end(); ++itr) { |
370 DCHECK_NE(RESOURCE_TYPE_GL_TEXTURE, itr->second.type); | 370 DCHECK_NE(RESOURCE_TYPE_GL_TEXTURE, itr->second.type); |
371 } | 371 } |
372 #endif // DCHECK_IS_ON() | 372 #endif // DCHECK_IS_ON() |
373 | 373 |
374 texture_id_allocator_ = nullptr; | 374 texture_id_allocator_ = nullptr; |
375 buffer_id_allocator_ = nullptr; | 375 buffer_id_allocator_ = nullptr; |
376 gl->Finish(); | 376 gl->Finish(); |
377 } | 377 } |
378 | 378 |
| 379 ResourceFormat ResourceProvider::memory_efficient_texture_format( |
| 380 bool must_support_alpha) const { |
| 381 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; |
| 382 } |
| 383 |
379 bool ResourceProvider::InUseByConsumer(ResourceId id) { | 384 bool ResourceProvider::InUseByConsumer(ResourceId id) { |
380 Resource* resource = GetResource(id); | 385 Resource* resource = GetResource(id); |
381 return resource->lock_for_read_count > 0 || resource->exported_count > 0 || | 386 return resource->lock_for_read_count > 0 || resource->exported_count > 0 || |
382 resource->lost; | 387 resource->lost; |
383 } | 388 } |
384 | 389 |
385 bool ResourceProvider::IsLost(ResourceId id) { | 390 bool ResourceProvider::IsLost(ResourceId id) { |
386 Resource* resource = GetResource(id); | 391 Resource* resource = GetResource(id); |
387 return resource->lost; | 392 return resource->lost; |
388 } | 393 } |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 const int kImportance = 2; | 1665 const int kImportance = 2; |
1661 pmd->CreateSharedGlobalAllocatorDump(guid); | 1666 pmd->CreateSharedGlobalAllocatorDump(guid); |
1662 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1667 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
1663 } | 1668 } |
1664 } | 1669 } |
1665 | 1670 |
1666 return true; | 1671 return true; |
1667 } | 1672 } |
1668 | 1673 |
1669 } // namespace cc | 1674 } // namespace cc |
OLD | NEW |