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_pool.h" | 5 #include "cc/resources/resource_pool.h" |
6 | 6 |
7 #include "cc/resources/resource_provider.h" | 7 #include "cc/resources/resource_provider.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 ResourcePool::Resource::Resource(cc::ResourceProvider* resource_provider, | 11 ResourcePool::Resource::Resource(cc::ResourceProvider* resource_provider, |
12 gfx::Size size, | 12 gfx::Size size, |
13 GLenum format) | 13 GLenum format) |
14 : cc::Resource(resource_provider->CreateManagedResource( | 14 : cc::Resource(resource_provider->CreateManagedResource( |
15 size, | 15 size, |
16 format, | 16 format, |
| 17 GL_CLAMP_TO_EDGE, |
17 ResourceProvider::TextureUsageAny), | 18 ResourceProvider::TextureUsageAny), |
18 size, | 19 size, |
19 format), | 20 format), |
20 resource_provider_(resource_provider) { | 21 resource_provider_(resource_provider) { |
21 DCHECK(id()); | 22 DCHECK(id()); |
22 } | 23 } |
23 | 24 |
24 ResourcePool::Resource::~Resource() { | 25 ResourcePool::Resource::~Resource() { |
25 DCHECK(id()); | 26 DCHECK(id()); |
26 DCHECK(resource_provider_); | 27 DCHECK(resource_provider_); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (resource_count_ > max_resource_count_) | 121 if (resource_count_ > max_resource_count_) |
121 return true; | 122 return true; |
122 if (memory_usage_bytes_ > max_memory_usage_bytes_) | 123 if (memory_usage_bytes_ > max_memory_usage_bytes_) |
123 return true; | 124 return true; |
124 if (unused_memory_usage_bytes_ > max_unused_memory_usage_bytes_) | 125 if (unused_memory_usage_bytes_ > max_unused_memory_usage_bytes_) |
125 return true; | 126 return true; |
126 return false; | 127 return false; |
127 } | 128 } |
128 | 129 |
129 } // namespace cc | 130 } // namespace cc |
OLD | NEW |