| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCTextureUpdateController.h" | 7 #include "CCTextureUpdateController.h" |
| 8 | 8 |
| 9 #include "GraphicsContext3D.h" | 9 #include "GraphicsContext3D.h" |
| 10 #include "TextureCopier.h" | 10 #include "TextureCopier.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Post a 0-delay task when no updates were left. When it runs, | 103 // Post a 0-delay task when no updates were left. When it runs, |
| 104 // readyToFinalizeTextureUpdates() will be called. | 104 // readyToFinalizeTextureUpdates() will be called. |
| 105 if (!updateMoreTexturesIfEnoughTimeRemaining()) | 105 if (!updateMoreTexturesIfEnoughTimeRemaining()) |
| 106 m_timer->startOneShot(0); | 106 m_timer->startOneShot(0); |
| 107 | 107 |
| 108 m_firstUpdateAttempt = false; | 108 m_firstUpdateAttempt = false; |
| 109 } else | 109 } else |
| 110 updateMoreTexturesNow(); | 110 updateMoreTexturesNow(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void CCTextureUpdateController::discardUploadsToEvictedResources() |
| 114 { |
| 115 m_queue->clearUploadsToEvictedResources(); |
| 116 } |
| 117 |
| 113 void CCTextureUpdateController::finalize() | 118 void CCTextureUpdateController::finalize() |
| 114 { | 119 { |
| 115 updateTextures(m_resourceProvider, m_uploader, m_queue.get()); | 120 updateTextures(m_resourceProvider, m_uploader, m_queue.get()); |
| 116 } | 121 } |
| 117 | 122 |
| 118 void CCTextureUpdateController::onTimerFired() | 123 void CCTextureUpdateController::onTimerFired() |
| 119 { | 124 { |
| 120 if (!updateMoreTexturesIfEnoughTimeRemaining()) | 125 if (!updateMoreTexturesIfEnoughTimeRemaining()) |
| 121 m_client->readyToFinalizeTextureUpdates(); | 126 m_client->readyToFinalizeTextureUpdates(); |
| 122 } | 127 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 183 } |
| 179 | 184 |
| 180 // Make sure there are no dangling partial uploads without a flush. | 185 // Make sure there are no dangling partial uploads without a flush. |
| 181 if (uploadCount % textureUploadFlushPeriod) | 186 if (uploadCount % textureUploadFlushPeriod) |
| 182 m_resourceProvider->shallowFlushIfSupported(); | 187 m_resourceProvider->shallowFlushIfSupported(); |
| 183 | 188 |
| 184 m_uploader->endUploads(); | 189 m_uploader->endUploads(); |
| 185 } | 190 } |
| 186 | 191 |
| 187 } | 192 } |
| OLD | NEW |