| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 resource_manager_->PrioritizeTextures(); | 120 resource_manager_->PrioritizeTextures(); |
| 121 | 121 |
| 122 output_surface_ = FakeOutputSurface::Create3d( | 122 output_surface_ = FakeOutputSurface::Create3d( |
| 123 scoped_ptr<TestWebGraphicsContext3D>( | 123 scoped_ptr<TestWebGraphicsContext3D>( |
| 124 new WebGraphicsContext3DForUploadTest(this))); | 124 new WebGraphicsContext3DForUploadTest(this))); |
| 125 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 125 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 126 | 126 |
| 127 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 127 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
| 128 resource_provider_ = ResourceProvider::Create( | 128 resource_provider_ = ResourceProvider::Create( |
| 129 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1); | 129 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1, |
| 130 false); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, | 133 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, |
| 133 int texture_index) { | 134 int texture_index) { |
| 134 full_upload_count_expected_ += count; | 135 full_upload_count_expected_ += count; |
| 135 total_upload_count_expected_ += count; | 136 total_upload_count_expected_ += count; |
| 136 | 137 |
| 137 const gfx::Rect rect(0, 0, 300, 150); | 138 const gfx::Rect rect(0, 0, 300, 150); |
| 138 const ResourceUpdate upload = ResourceUpdate::Create( | 139 const ResourceUpdate upload = ResourceUpdate::Create( |
| 139 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); | 140 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 RunPendingTask(task_runner.get(), controller.get()); | 504 RunPendingTask(task_runner.get(), controller.get()); |
| 504 } | 505 } |
| 505 | 506 |
| 506 EXPECT_FALSE(task_runner->HasPendingTask()); | 507 EXPECT_FALSE(task_runner->HasPendingTask()); |
| 507 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 508 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
| 508 EXPECT_EQ(2, num_total_uploads_); | 509 EXPECT_EQ(2, num_total_uploads_); |
| 509 } | 510 } |
| 510 | 511 |
| 511 } // namespace | 512 } // namespace |
| 512 } // namespace cc | 513 } // namespace cc |
| OLD | NEW |