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

Unified Diff: cc/resource_update_controller.cc

Issue 11367054: cc: Move textureUploadFlushPeriod to TextureUploader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/resource_provider.cc ('k') | cc/texture_uploader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resource_update_controller.cc
diff --git a/cc/resource_update_controller.cc b/cc/resource_update_controller.cc
index 55c52775124e103dda99b57e92bd70161cc86875..38043b06d786099cdfe31c0d2dcfb7aae0018b86 100644
--- a/cc/resource_update_controller.cc
+++ b/cc/resource_update_controller.cc
@@ -32,9 +32,6 @@ const double textureUpdateTickRate = 0.004;
// Measured in seconds.
const double uploaderBusyTickRate = 0.001;
-// Flush interval when performing texture uploads.
-const int textureUploadFlushPeriod = 4;
-
// Number of blocking update intervals to allow.
const size_t maxBlockingUpdateIntervals = 4;
@@ -193,25 +190,13 @@ void ResourceUpdateController::updateTexture(ResourceUpdate update)
void ResourceUpdateController::finalize()
{
- size_t uploadCount = 0;
- while (m_queue->fullUploadSize()) {
- if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
- m_resourceProvider->shallowFlushIfSupported();
-
+ while (m_queue->fullUploadSize())
updateTexture(m_queue->takeFirstFullUpload());
- uploadCount++;
- }
-
- while (m_queue->partialUploadSize()) {
- if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
- m_resourceProvider->shallowFlushIfSupported();
+ while (m_queue->partialUploadSize())
updateTexture(m_queue->takeFirstPartialUpload());
- uploadCount++;
- }
- if (uploadCount)
- m_resourceProvider->shallowFlushIfSupported();
+ m_resourceProvider->flushUploads();
if (m_queue->copySize()) {
TextureCopier* copier = m_resourceProvider->textureCopier();
@@ -291,14 +276,10 @@ void ResourceUpdateController::updateMoreTexturesNow()
if (!uploads)
return;
- size_t uploadCount = 0;
- while (m_queue->fullUploadSize() && uploadCount < uploads) {
- if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
- m_resourceProvider->shallowFlushIfSupported();
+ while (m_queue->fullUploadSize() && uploads--)
updateTexture(m_queue->takeFirstFullUpload());
- uploadCount++;
- }
- m_resourceProvider->shallowFlushIfSupported();
+
+ m_resourceProvider->flushUploads();
}
} // namespace cc
« no previous file with comments | « cc/resource_provider.cc ('k') | cc/texture_uploader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698