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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 void appendFullUploadsOfIndexedTextureToUpdateQueue(int count, int textureIn
dex) | 140 void appendFullUploadsOfIndexedTextureToUpdateQueue(int count, int textureIn
dex) |
141 { | 141 { |
142 m_fullUploadCountExpected += count; | 142 m_fullUploadCountExpected += count; |
143 m_totalUploadCountExpected += count; | 143 m_totalUploadCountExpected += count; |
144 | 144 |
145 const gfx::Rect rect(0, 0, 300, 150); | 145 const gfx::Rect rect(0, 0, 300, 150); |
146 const ResourceUpdate upload = ResourceUpdate::Create( | 146 const ResourceUpdate upload = ResourceUpdate::Create( |
147 textures_[textureIndex].get(), &m_bitmap, rect, rect, gfx::Vector2d(
)); | 147 textures_[textureIndex].get(), &m_bitmap, rect, rect, gfx::Vector2d(
)); |
148 for (int i = 0; i < count; i++) | 148 for (int i = 0; i < count; i++) |
149 m_queue->appendFullUpload(upload); | 149 m_queue->AppendFullUpload(upload); |
150 } | 150 } |
151 | 151 |
152 void appendFullUploadsToUpdateQueue(int count) | 152 void appendFullUploadsToUpdateQueue(int count) |
153 { | 153 { |
154 appendFullUploadsOfIndexedTextureToUpdateQueue(count, 0); | 154 appendFullUploadsOfIndexedTextureToUpdateQueue(count, 0); |
155 } | 155 } |
156 | 156 |
157 void appendPartialUploadsOfIndexedTextureToUpdateQueue(int count, int textur
eIndex) | 157 void appendPartialUploadsOfIndexedTextureToUpdateQueue(int count, int textur
eIndex) |
158 { | 158 { |
159 m_partialCountExpected += count; | 159 m_partialCountExpected += count; |
160 m_totalUploadCountExpected += count; | 160 m_totalUploadCountExpected += count; |
161 | 161 |
162 const gfx::Rect rect(0, 0, 100, 100); | 162 const gfx::Rect rect(0, 0, 100, 100); |
163 const ResourceUpdate upload = ResourceUpdate::Create( | 163 const ResourceUpdate upload = ResourceUpdate::Create( |
164 textures_[textureIndex].get(), &m_bitmap, rect, rect, gfx::Vector2d(
)); | 164 textures_[textureIndex].get(), &m_bitmap, rect, rect, gfx::Vector2d(
)); |
165 for (int i = 0; i < count; i++) | 165 for (int i = 0; i < count; i++) |
166 m_queue->appendPartialUpload(upload); | 166 m_queue->AppendPartialUpload(upload); |
167 } | 167 } |
168 | 168 |
169 void appendPartialUploadsToUpdateQueue(int count) | 169 void appendPartialUploadsToUpdateQueue(int count) |
170 { | 170 { |
171 appendPartialUploadsOfIndexedTextureToUpdateQueue(count, 0); | 171 appendPartialUploadsOfIndexedTextureToUpdateQueue(count, 0); |
172 } | 172 } |
173 | 173 |
174 void setMaxUploadCountPerUpdate(int count) | 174 void setMaxUploadCountPerUpdate(int count) |
175 { | 175 { |
176 m_maxUploadCountPerUpdate = count; | 176 m_maxUploadCountPerUpdate = count; |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 runPendingTask(&thread, controller.get()); | 496 runPendingTask(&thread, controller.get()); |
497 } | 497 } |
498 | 498 |
499 EXPECT_FALSE(thread.hasPendingTask()); | 499 EXPECT_FALSE(thread.hasPendingTask()); |
500 EXPECT_TRUE(client.readyToFinalizeCalled()); | 500 EXPECT_TRUE(client.readyToFinalizeCalled()); |
501 EXPECT_EQ(2, m_numTotalUploads); | 501 EXPECT_EQ(2, m_numTotalUploads); |
502 } | 502 } |
503 | 503 |
504 } // namespace | 504 } // namespace |
505 } // namespace cc | 505 } // namespace cc |
OLD | NEW |