| 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/prioritized_resource.h" | 5 #include "cc/resources/prioritized_resource.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "cc/resources/prioritized_resource_manager.h" | 9 #include "cc/resources/prioritized_resource_manager.h" |
| 10 #include "cc/resources/resource.h" | 10 #include "cc/resources/resource.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class PrioritizedResourceTest : public testing::Test { | 22 class PrioritizedResourceTest : public testing::Test { |
| 23 public: | 23 public: |
| 24 PrioritizedResourceTest() | 24 PrioritizedResourceTest() |
| 25 : texture_size_(256, 256), | 25 : texture_size_(256, 256), |
| 26 texture_format_(RGBA_8888), | 26 texture_format_(RGBA_8888), |
| 27 output_surface_(FakeOutputSurface::Create3d()) { | 27 output_surface_(FakeOutputSurface::Create3d()) { |
| 28 DebugScopedSetImplThread impl_thread(&proxy_); | 28 DebugScopedSetImplThread impl_thread(&proxy_); |
| 29 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 29 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 30 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 30 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
| 31 resource_provider_ = ResourceProvider::Create( | 31 resource_provider_ = ResourceProvider::Create( |
| 32 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1); | 32 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1, |
| 33 false); |
| 33 } | 34 } |
| 34 | 35 |
| 35 virtual ~PrioritizedResourceTest() { | 36 virtual ~PrioritizedResourceTest() { |
| 36 DebugScopedSetImplThread impl_thread(&proxy_); | 37 DebugScopedSetImplThread impl_thread(&proxy_); |
| 37 resource_provider_.reset(); | 38 resource_provider_.reset(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 size_t TexturesMemorySize(size_t texture_count) { | 41 size_t TexturesMemorySize(size_t texture_count) { |
| 41 return Resource::MemorySizeBytes(texture_size_, texture_format_) * | 42 return Resource::MemorySizeBytes(texture_size_, texture_format_) * |
| 42 texture_count; | 43 texture_count; |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 resource_manager->MemoryVisibleAndNearbyBytes()); | 1104 resource_manager->MemoryVisibleAndNearbyBytes()); |
| 1104 } | 1105 } |
| 1105 | 1106 |
| 1106 DebugScopedSetImplThreadAndMainThreadBlocked | 1107 DebugScopedSetImplThreadAndMainThreadBlocked |
| 1107 impl_thread_and_main_thread_blocked(&proxy_); | 1108 impl_thread_and_main_thread_blocked(&proxy_); |
| 1108 resource_manager->ClearAllMemory(resource_provider()); | 1109 resource_manager->ClearAllMemory(resource_provider()); |
| 1109 } | 1110 } |
| 1110 | 1111 |
| 1111 } // namespace | 1112 } // namespace |
| 1112 } // namespace cc | 1113 } // namespace cc |
| OLD | NEW |