OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "gpu/command_buffer/service/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "gpu/command_buffer/service/error_state_mock.h" | 10 #include "gpu/command_buffer/service/error_state_mock.h" |
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 | 2162 |
2163 class CountingMemoryTracker : public MemoryTracker { | 2163 class CountingMemoryTracker : public MemoryTracker { |
2164 public: | 2164 public: |
2165 CountingMemoryTracker() { | 2165 CountingMemoryTracker() { |
2166 current_size_[0] = 0; | 2166 current_size_[0] = 0; |
2167 current_size_[1] = 0; | 2167 current_size_[1] = 0; |
2168 } | 2168 } |
2169 | 2169 |
2170 virtual void TrackMemoryAllocatedChange(size_t old_size, | 2170 virtual void TrackMemoryAllocatedChange(size_t old_size, |
2171 size_t new_size, | 2171 size_t new_size, |
2172 Pool pool) OVERRIDE { | 2172 Pool pool) override { |
2173 DCHECK_LT(static_cast<size_t>(pool), arraysize(current_size_)); | 2173 DCHECK_LT(static_cast<size_t>(pool), arraysize(current_size_)); |
2174 current_size_[pool] += new_size - old_size; | 2174 current_size_[pool] += new_size - old_size; |
2175 } | 2175 } |
2176 | 2176 |
2177 virtual bool EnsureGPUMemoryAvailable(size_t size_needed) OVERRIDE { | 2177 virtual bool EnsureGPUMemoryAvailable(size_t size_needed) override { |
2178 return true; | 2178 return true; |
2179 } | 2179 } |
2180 | 2180 |
2181 size_t GetSize(Pool pool) { | 2181 size_t GetSize(Pool pool) { |
2182 DCHECK_LT(static_cast<size_t>(pool), arraysize(current_size_)); | 2182 DCHECK_LT(static_cast<size_t>(pool), arraysize(current_size_)); |
2183 return current_size_[pool]; | 2183 return current_size_[pool]; |
2184 } | 2184 } |
2185 | 2185 |
2186 private: | 2186 private: |
2187 virtual ~CountingMemoryTracker() {} | 2187 virtual ~CountingMemoryTracker() {} |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 | 2500 |
2501 EXPECT_CALL(*gl_, DeleteTextures(1, _)) | 2501 EXPECT_CALL(*gl_, DeleteTextures(1, _)) |
2502 .Times(1) | 2502 .Times(1) |
2503 .RetiresOnSaturation(); | 2503 .RetiresOnSaturation(); |
2504 texture_manager1_->RemoveTexture(10); | 2504 texture_manager1_->RemoveTexture(10); |
2505 texture_manager2_->RemoveTexture(20); | 2505 texture_manager2_->RemoveTexture(20); |
2506 } | 2506 } |
2507 | 2507 |
2508 } // namespace gles2 | 2508 } // namespace gles2 |
2509 } // namespace gpu | 2509 } // namespace gpu |
OLD | NEW |