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

Unified Diff: cc/CCTextureUpdateController.cpp

Issue 10950008: cc: Remove CCTextureUpdateController::updateTextures(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 c1e8f31be0d73411f6bc4c3e2c76fc1f02bad878..ab4b183cd9ee6d4a6d795bcae5e2558a60464d44 100644
--- a/cc/CCTextureUpdateController.cpp
+++ b/cc/CCTextureUpdateController.cpp
@@ -43,43 +43,6 @@ size_t CCTextureUpdateController::maxFullUpdatesPerTick(TextureUploader* uploade
return texturesPerTick ? texturesPerTick : 1;
}
-void CCTextureUpdateController::updateTextures(CCResourceProvider* resourceProvider, TextureUploader* uploader, CCTextureUpdateQueue* queue)
-{
- size_t uploadCount = 0;
- while (queue->fullUploadSize()) {
- if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
- resourceProvider->shallowFlushIfSupported();
-
- uploader->uploadTexture(
- resourceProvider, queue->takeFirstFullUpload());
- uploadCount++;
- }
-
- while (queue->partialUploadSize()) {
- if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
- resourceProvider->shallowFlushIfSupported();
-
- uploader->uploadTexture(
- resourceProvider, queue->takeFirstPartialUpload());
- uploadCount++;
- }
-
- if (uploadCount)
- resourceProvider->shallowFlushIfSupported();
-
- if (queue->copySize()) {
- TextureCopier* copier = resourceProvider->textureCopier();
- 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, TextureUploader* uploader)
: m_client(client)
, m_timer(adoptPtr(new CCTimer(thread, this)))
@@ -127,7 +90,39 @@ void CCTextureUpdateController::discardUploadsToEvictedResources()
void CCTextureUpdateController::finalize()
{
- updateTextures(m_resourceProvider, m_uploader, m_queue.get());
+ size_t uploadCount = 0;
+ while (m_queue->fullUploadSize()) {
+ if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
+ m_resourceProvider->shallowFlushIfSupported();
+
+ m_uploader->uploadTexture(
+ m_resourceProvider, m_queue->takeFirstFullUpload());
+ uploadCount++;
+ }
+
+ while (m_queue->partialUploadSize()) {
+ if (!(uploadCount % textureUploadFlushPeriod) && uploadCount)
+ m_resourceProvider->shallowFlushIfSupported();
+
+ m_uploader->uploadTexture(
+ m_resourceProvider, m_queue->takeFirstPartialUpload());
+ uploadCount++;
+ }
+
+ if (uploadCount)
+ m_resourceProvider->shallowFlushIfSupported();
+
+ if (m_queue->copySize()) {
+ TextureCopier* copier = m_resourceProvider->textureCopier();
+ while (m_queue->copySize())
+ copier->copyTexture(m_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();
+ }
}
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