Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4360)

Unified Diff: cc/CCTextureUpdateController.cpp

Issue 10937007: cc: Only use upload throttling when performing full texture uploads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/CCTextureUpdateController.h ('k') | cc/CCTextureUpdateControllerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCTextureUpdateController.cpp
diff --git a/cc/CCTextureUpdateController.cpp b/cc/CCTextureUpdateController.cpp
index 22207de75f9adf58e4094922578427d865dc25e6..65186e5b0260d04ebf3bc6d33f53ac382cb9ac9a 100644
--- a/cc/CCTextureUpdateController.cpp
+++ b/cc/CCTextureUpdateController.cpp
@@ -34,65 +34,40 @@ size_t CCTextureUpdateController::maxPartialTextureUpdates()
return textureUpdatesPerTick;
}
-void CCTextureUpdateController::updateTextures(CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader, CCTextureUpdateQueue* queue, size_t count)
+void CCTextureUpdateController::updateTextures(CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader, CCTextureUpdateQueue* queue)
{
- if (queue->fullUploadSize() || queue->partialUploadSize()) {
- if (uploader->isBusy())
- return;
-
- uploader->beginUploads();
-
- size_t fullUploadCount = 0;
- while (queue->fullUploadSize() && fullUploadCount < count) {
- uploader->uploadTexture(resourceProvider, queue->takeFirstFullUpload());
- fullUploadCount++;
- if (!(fullUploadCount % textureUploadFlushPeriod))
- resourceProvider->shallowFlushIfSupported();
- }
-
- // Make sure there are no dangling uploads without a flush.
- if (fullUploadCount % textureUploadFlushPeriod)
+ size_t uploadCount = 0;
+ while (queue->fullUploadSize()) {
+ if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
resourceProvider->shallowFlushIfSupported();
- bool moreUploads = queue->fullUploadSize();
-
- ASSERT(queue->partialUploadSize() <= count);
- // We need another update batch if the number of updates remaining
- // in |count| is greater than the remaining partial entries.
- if ((count - fullUploadCount) < queue->partialUploadSize())
- moreUploads = true;
-
- if (moreUploads) {
- uploader->endUploads();
- return;
- }
-
- size_t partialUploadCount = 0;
- while (queue->partialUploadSize()) {
- uploader->uploadTexture(resourceProvider, queue->takeFirstPartialUpload());
- partialUploadCount++;
- if (!(partialUploadCount % textureUploadFlushPeriod))
- resourceProvider->shallowFlushIfSupported();
- }
-
- // Make sure there are no dangling partial uploads without a flush.
- if (partialUploadCount % textureUploadFlushPeriod)
+ uploader->uploadTexture(
+ resourceProvider, queue->takeFirstFullUpload());
+ uploadCount++;
+ }
+
+ while (queue->partialUploadSize()) {
+ if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
resourceProvider->shallowFlushIfSupported();
- uploader->endUploads();
+ uploader->uploadTexture(
+ resourceProvider, queue->takeFirstPartialUpload());
+ uploadCount++;
}
- size_t copyCount = 0;
- while (queue->copySize()) {
- copier->copyTexture(queue->takeFirstCopy());
- copyCount++;
- }
+ if (uploadCount)
nduca 2012/09/18 06:03:58 I'm so confused, how do you even have incremental
reveman 2012/09/18 06:26:03 Incremental uploads are now done in CCTextureUpdat
+ resourceProvider->shallowFlushIfSupported();
- // If we've performed any texture copies, we need to insert a flush here into the compositor context
- // before letting the main thread proceed as it may make draw calls to the source texture of one of
- // our copy operations.
- if (copyCount)
+ if (queue->copySize()) {
+ while (queue->copySize())
+ copier->copyTexture(queue->takeFirstCopy());
+
+ // If we've performed any texture copies, we need to insert a flush
+ // here into the compositor context before letting the main thread
+ // proceed as it may make draw calls to the source texture of one of
+ // our copy operations.
copier->flush();
+ }
}
CCTextureUpdateController::CCTextureUpdateController(CCTextureUpdateControllerClient* client, CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureCopier* copier, TextureUploader* uploader)
@@ -137,9 +112,7 @@ void CCTextureUpdateController::performMoreUpdates(
void CCTextureUpdateController::finalize()
{
- while (m_queue->hasMoreUpdates())
- updateTextures(m_resourceProvider, m_copier, m_uploader, m_queue.get(),
- updateMoreTexturesSize());
+ updateTextures(m_resourceProvider, m_copier, m_uploader, m_queue.get());
}
void CCTextureUpdateController::onTimerFired()
« no previous file with comments | « cc/CCTextureUpdateController.h ('k') | cc/CCTextureUpdateControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698