| 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 "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
| 8 #include "cc/resources/prioritized_resource_manager.h" | 8 #include "cc/resources/prioritized_resource_manager.h" |
| 9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
| 10 #include "cc/test/fake_output_surface_client.h" | 10 #include "cc/test/fake_output_surface_client.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 set_request_priority(PriorityCalculator::VisiblePriority(true)); | 130 set_request_priority(PriorityCalculator::VisiblePriority(true)); |
| 131 } | 131 } |
| 132 resource_manager_->PrioritizeTextures(); | 132 resource_manager_->PrioritizeTextures(); |
| 133 | 133 |
| 134 output_surface_ = FakeOutputSurface::Create3d( | 134 output_surface_ = FakeOutputSurface::Create3d( |
| 135 scoped_ptr<TestWebGraphicsContext3D>( | 135 scoped_ptr<TestWebGraphicsContext3D>( |
| 136 new WebGraphicsContext3DForUploadTest(this))); | 136 new WebGraphicsContext3DForUploadTest(this))); |
| 137 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 137 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 138 | 138 |
| 139 resource_provider_ = | 139 resource_provider_ = |
| 140 ResourceProvider::Create(output_surface_.get(), NULL, 0, false); | 140 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); |
| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 RunPendingTask(task_runner.get(), controller.get()); | 510 RunPendingTask(task_runner.get(), controller.get()); |
| 511 } | 511 } |
| 512 | 512 |
| 513 EXPECT_FALSE(task_runner->HasPendingTask()); | 513 EXPECT_FALSE(task_runner->HasPendingTask()); |
| 514 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 514 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
| 515 EXPECT_EQ(2, num_total_uploads_); | 515 EXPECT_EQ(2, num_total_uploads_); |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace | 518 } // namespace |
| 519 } // namespace cc | 519 } // namespace cc |
| OLD | NEW |