| 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/debug/overdraw_metrics.h" | 7 #include "cc/debug/overdraw_metrics.h" |
| 8 #include "cc/resources/prioritized_resource_manager.h" | 8 #include "cc/resources/prioritized_resource_manager.h" |
| 9 #include "cc/resources/resource_provider.h" | 9 #include "cc/resources/resource_provider.h" |
| 10 #include "cc/resources/resource_update_queue.h" | 10 #include "cc/resources/resource_update_queue.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 layer_tree_host_->contents_texture_manager()->PrioritizeTextures(); | 97 layer_tree_host_->contents_texture_manager()->PrioritizeTextures(); |
| 98 | 98 |
| 99 FakeOutputSurfaceClient output_surface_client; | 99 FakeOutputSurfaceClient output_surface_client; |
| 100 scoped_ptr<OutputSurface> output_surface; | 100 scoped_ptr<OutputSurface> output_surface; |
| 101 scoped_ptr<ResourceProvider> resource_provider; | 101 scoped_ptr<ResourceProvider> resource_provider; |
| 102 { | 102 { |
| 103 DebugScopedSetImplThread impl_thread(Proxy()); | 103 DebugScopedSetImplThread impl_thread(Proxy()); |
| 104 DebugScopedSetMainThreadBlocked main_thread_blocked(Proxy()); | 104 DebugScopedSetMainThreadBlocked main_thread_blocked(Proxy()); |
| 105 output_surface = FakeOutputSurface::Create3d(); | 105 output_surface = FakeOutputSurface::Create3d(); |
| 106 CHECK(output_surface->BindToClient(&output_surface_client)); | 106 CHECK(output_surface->BindToClient(&output_surface_client)); |
| 107 resource_provider = ResourceProvider::Create(output_surface.get(), 0); | 107 resource_provider = |
| 108 ResourceProvider::Create(output_surface.get(), 0, false); |
| 108 params.texture->AcquireBackingTexture(resource_provider.get()); | 109 params.texture->AcquireBackingTexture(resource_provider.get()); |
| 109 ASSERT_TRUE(params.texture->have_backing_texture()); | 110 ASSERT_TRUE(params.texture->have_backing_texture()); |
| 110 } | 111 } |
| 111 | 112 |
| 112 // Nothing changed, so no repeated upload. | 113 // Nothing changed, so no repeated upload. |
| 113 test_layer->SavePaintProperties(); | 114 test_layer->SavePaintProperties(); |
| 114 test_layer->SetTexturePriorities(calculator); | 115 test_layer->SetTexturePriorities(calculator); |
| 115 test_layer->Update(&queue, &occlusion_tracker); | 116 test_layer->Update(&queue, &occlusion_tracker); |
| 116 EXPECT_EQ(0u, queue.FullUploadSize()); | 117 EXPECT_EQ(0u, queue.FullUploadSize()); |
| 117 EXPECT_EQ(0u, queue.PartialUploadSize()); | 118 EXPECT_EQ(0u, queue.PartialUploadSize()); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 140 EXPECT_EQ(1u, queue2.FullUploadSize()); | 141 EXPECT_EQ(1u, queue2.FullUploadSize()); |
| 141 EXPECT_EQ(0u, queue2.PartialUploadSize()); | 142 EXPECT_EQ(0u, queue2.PartialUploadSize()); |
| 142 params = queue2.TakeFirstFullUpload(); | 143 params = queue2.TakeFirstFullUpload(); |
| 143 EXPECT_TRUE(params.texture != NULL); | 144 EXPECT_TRUE(params.texture != NULL); |
| 144 EXPECT_EQ(params.texture->resource_manager(), | 145 EXPECT_EQ(params.texture->resource_manager(), |
| 145 layer_tree_host_->contents_texture_manager()); | 146 layer_tree_host_->contents_texture_manager()); |
| 146 } | 147 } |
| 147 | 148 |
| 148 } // namespace | 149 } // namespace |
| 149 } // namespace cc | 150 } // namespace cc |
| OLD | NEW |