| 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/resource_update_controller.h" | 5 #include "cc/resources/resource_update_controller.h" |
| 6 | 6 |
| 7 #include "cc/resources/prioritized_resource_manager.h" | 7 #include "cc/resources/prioritized_resource_manager.h" |
| 8 #include "cc/test/fake_output_surface.h" | 8 #include "cc/test/fake_output_surface.h" |
| 9 #include "cc/test/fake_proxy.h" | 9 #include "cc/test/fake_proxy.h" |
| 10 #include "cc/test/scheduler_test_common.h" | 10 #include "cc/test/scheduler_test_common.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 bitmap_.allocPixels(); | 130 bitmap_.allocPixels(); |
| 131 | 131 |
| 132 for (int i = 0; i < 4; i++) { | 132 for (int i = 0; i < 4; i++) { |
| 133 textures_[i] = PrioritizedResource::Create(resource_manager_.get(), | 133 textures_[i] = PrioritizedResource::Create(resource_manager_.get(), |
| 134 gfx::Size(300, 150), GL_RGBA); | 134 gfx::Size(300, 150), GL_RGBA); |
| 135 textures_[i]-> | 135 textures_[i]-> |
| 136 set_request_priority(PriorityCalculator::VisiblePriority(true)); | 136 set_request_priority(PriorityCalculator::VisiblePriority(true)); |
| 137 } | 137 } |
| 138 resource_manager_->PrioritizeTextures(); | 138 resource_manager_->PrioritizeTextures(); |
| 139 | 139 |
| 140 resource_provider_ = ResourceProvider::Create(output_surface_.get()); | 140 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, | 143 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, |
| 144 int texture_index) { | 144 int texture_index) { |
| 145 full_upload_count_expected_ += count; | 145 full_upload_count_expected_ += count; |
| 146 total_upload_count_expected_ += count; | 146 total_upload_count_expected_ += count; |
| 147 | 147 |
| 148 const gfx::Rect rect(0, 0, 300, 150); | 148 const gfx::Rect rect(0, 0, 300, 150); |
| 149 const ResourceUpdate upload = ResourceUpdate::Create( | 149 const ResourceUpdate upload = ResourceUpdate::Create( |
| 150 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); | 150 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 RunPendingTask(&thread, controller.get()); | 498 RunPendingTask(&thread, controller.get()); |
| 499 } | 499 } |
| 500 | 500 |
| 501 EXPECT_FALSE(thread.HasPendingTask()); | 501 EXPECT_FALSE(thread.HasPendingTask()); |
| 502 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 502 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
| 503 EXPECT_EQ(2, num_total_uploads_); | 503 EXPECT_EQ(2, num_total_uploads_); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace | 506 } // namespace |
| 507 } // namespace cc | 507 } // namespace cc |
| OLD | NEW |