| 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/layers/nine_patch_layer.h" | 5 #include "cc/layers/nine_patch_layer.h" |
| 6 | 6 |
| 7 #include "cc/base/thread.h" | 7 #include "cc/base/thread.h" |
| 8 #include "cc/debug/overdraw_metrics.h" | 8 #include "cc/debug/overdraw_metrics.h" |
| 9 #include "cc/resources/prioritized_resource_manager.h" | 9 #include "cc/resources/prioritized_resource_manager.h" |
| 10 #include "cc/resources/resource_provider.h" | 10 #include "cc/resources/resource_provider.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 layer_tree_host_->contents_texture_manager()->SetMaxMemoryLimitBytes( | 93 layer_tree_host_->contents_texture_manager()->SetMaxMemoryLimitBytes( |
| 94 1024 * 1024); | 94 1024 * 1024); |
| 95 layer_tree_host_->contents_texture_manager()->PrioritizeTextures(); | 95 layer_tree_host_->contents_texture_manager()->PrioritizeTextures(); |
| 96 | 96 |
| 97 scoped_ptr<OutputSurface> output_surface; | 97 scoped_ptr<OutputSurface> output_surface; |
| 98 scoped_ptr<ResourceProvider> resource_provider; | 98 scoped_ptr<ResourceProvider> resource_provider; |
| 99 { | 99 { |
| 100 DebugScopedSetImplThread impl_thread(Proxy()); | 100 DebugScopedSetImplThread impl_thread(Proxy()); |
| 101 DebugScopedSetMainThreadBlocked main_thread_blocked(Proxy()); | 101 DebugScopedSetMainThreadBlocked main_thread_blocked(Proxy()); |
| 102 output_surface = CreateFakeOutputSurface(); | 102 output_surface = CreateFakeOutputSurface(); |
| 103 resource_provider = ResourceProvider::Create(output_surface.get()); | 103 resource_provider = ResourceProvider::Create(output_surface.get(), 0); |
| 104 params.texture->AcquireBackingTexture(resource_provider.get()); | 104 params.texture->AcquireBackingTexture(resource_provider.get()); |
| 105 ASSERT_TRUE(params.texture->have_backing_texture()); | 105 ASSERT_TRUE(params.texture->have_backing_texture()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Nothing changed, so no repeated upload. | 108 // Nothing changed, so no repeated upload. |
| 109 test_layer->SetTexturePriorities(calculator); | 109 test_layer->SetTexturePriorities(calculator); |
| 110 test_layer->Update(&queue, &occlusion_tracker, NULL); | 110 test_layer->Update(&queue, &occlusion_tracker, NULL); |
| 111 EXPECT_EQ(0u, queue.FullUploadSize()); | 111 EXPECT_EQ(0u, queue.FullUploadSize()); |
| 112 EXPECT_EQ(0u, queue.PartialUploadSize()); | 112 EXPECT_EQ(0u, queue.PartialUploadSize()); |
| 113 { | 113 { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 133 EXPECT_EQ(1u, queue2.FullUploadSize()); | 133 EXPECT_EQ(1u, queue2.FullUploadSize()); |
| 134 EXPECT_EQ(0u, queue2.PartialUploadSize()); | 134 EXPECT_EQ(0u, queue2.PartialUploadSize()); |
| 135 params = queue2.TakeFirstFullUpload(); | 135 params = queue2.TakeFirstFullUpload(); |
| 136 EXPECT_TRUE(params.texture != NULL); | 136 EXPECT_TRUE(params.texture != NULL); |
| 137 EXPECT_EQ(params.texture->resource_manager(), | 137 EXPECT_EQ(params.texture->resource_manager(), |
| 138 layer_tree_host_->contents_texture_manager()); | 138 layer_tree_host_->contents_texture_manager()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace | 141 } // namespace |
| 142 } // namespace cc | 142 } // namespace cc |
| OLD | NEW |