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 "cc/resources/prioritized_resource_manager.h" | 7 #include "cc/resources/prioritized_resource_manager.h" |
8 #include "cc/resources/resource.h" | 8 #include "cc/resources/resource.h" |
9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
10 #include "cc/test/fake_proxy.h" | 10 #include "cc/test/fake_proxy.h" |
11 #include "cc/test/tiled_layer_test_common.h" | 11 #include "cc/test/tiled_layer_test_common.h" |
12 #include "cc/trees/single_thread_proxy.h" // For DebugScopedSetImplThread | 12 #include "cc/trees/single_thread_proxy.h" // For DebugScopedSetImplThread |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class PrioritizedResourceTest : public testing::Test { | 17 class PrioritizedResourceTest : public testing::Test { |
18 public: | 18 public: |
19 PrioritizedResourceTest() | 19 PrioritizedResourceTest() |
20 : proxy_(scoped_ptr<Thread>(NULL)), | 20 : proxy_(scoped_ptr<Thread>()), |
21 texture_size_(256, 256), | 21 texture_size_(256, 256), |
22 texture_format_(GL_RGBA), | 22 texture_format_(GL_RGBA), |
23 output_surface_(CreateFakeOutputSurface()) { | 23 output_surface_(CreateFakeOutputSurface()) { |
24 DebugScopedSetImplThread impl_thread(&proxy_); | 24 DebugScopedSetImplThread impl_thread(&proxy_); |
25 resource_provider_ = cc::ResourceProvider::Create(output_surface_.get(), 0); | 25 resource_provider_ = cc::ResourceProvider::Create(output_surface_.get(), 0); |
26 } | 26 } |
27 | 27 |
28 virtual ~PrioritizedResourceTest() { | 28 virtual ~PrioritizedResourceTest() { |
29 DebugScopedSetImplThread impl_thread(&proxy_); | 29 DebugScopedSetImplThread impl_thread(&proxy_); |
30 resource_provider_.reset(); | 30 resource_provider_.reset(); |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 resource_manager->MemoryVisibleAndNearbyBytes()); | 793 resource_manager->MemoryVisibleAndNearbyBytes()); |
794 } | 794 } |
795 | 795 |
796 DebugScopedSetImplThreadAndMainThreadBlocked | 796 DebugScopedSetImplThreadAndMainThreadBlocked |
797 impl_thread_and_main_thread_blocked(&proxy_); | 797 impl_thread_and_main_thread_blocked(&proxy_); |
798 resource_manager->ClearAllMemory(ResourceProvider()); | 798 resource_manager->ClearAllMemory(ResourceProvider()); |
799 } | 799 } |
800 | 800 |
801 } // namespace | 801 } // namespace |
802 } // namespace cc | 802 } // namespace cc |
OLD | NEW |