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/resource_update_controller.h" | 5 #include "cc/resource_update_controller.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/prioritized_resource.h" | 8 #include "cc/prioritized_resource.h" |
9 #include "cc/resource_provider.h" | 9 #include "cc/resource_provider.h" |
10 #include "cc/texture_copier.h" | 10 #include "cc/texture_copier.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // here into the compositor context before letting the main thread | 210 // here into the compositor context before letting the main thread |
211 // proceed as it may make draw calls to the source texture of one of | 211 // proceed as it may make draw calls to the source texture of one of |
212 // our copy operations. | 212 // our copy operations. |
213 copier->flush(); | 213 copier->flush(); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 void ResourceUpdateController::onTimerFired() | 217 void ResourceUpdateController::onTimerFired() |
218 { | 218 { |
219 m_taskPosted = false; | 219 m_taskPosted = false; |
220 ResourceProvider::debugNotifyEnterZone(0xB000000); | |
221 if (!updateMoreTexturesIfEnoughTimeRemaining()) | 220 if (!updateMoreTexturesIfEnoughTimeRemaining()) |
222 m_client->readyToFinalizeTextureUpdates(); | 221 m_client->readyToFinalizeTextureUpdates(); |
223 ResourceProvider::debugNotifyLeaveZone(); | |
224 } | 222 } |
225 | 223 |
226 base::TimeTicks ResourceUpdateController::now() const | 224 base::TimeTicks ResourceUpdateController::now() const |
227 { | 225 { |
228 return base::TimeTicks::Now(); | 226 return base::TimeTicks::Now(); |
229 } | 227 } |
230 | 228 |
231 base::TimeDelta ResourceUpdateController::updateMoreTexturesTime() const | 229 base::TimeDelta ResourceUpdateController::updateMoreTexturesTime() const |
232 { | 230 { |
233 return base::TimeDelta::FromMilliseconds(textureUpdateTickRate * 1000); | 231 return base::TimeDelta::FromMilliseconds(textureUpdateTickRate * 1000); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 if (!uploads) | 284 if (!uploads) |
287 return; | 285 return; |
288 | 286 |
289 while (m_queue->fullUploadSize() && uploads--) | 287 while (m_queue->fullUploadSize() && uploads--) |
290 updateTexture(m_queue->takeFirstFullUpload()); | 288 updateTexture(m_queue->takeFirstFullUpload()); |
291 | 289 |
292 m_resourceProvider->flushUploads(); | 290 m_resourceProvider->flushUploads(); |
293 } | 291 } |
294 | 292 |
295 } // namespace cc | 293 } // namespace cc |
OLD | NEW |