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

Side by Side Diff: cc/CCThreadProxy.cpp

Issue 10947017: Enable removing uploads to evicted textures from texture upload queues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/CCTextureUpdateQueue.cpp ('k') | cc/LayerTextureUpdater.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "CCThreadProxy.h" 7 #include "CCThreadProxy.h"
8 8
9 #include "CCDelayBasedTimeSource.h" 9 #include "CCDelayBasedTimeSource.h"
10 #include "CCDrawQuad.h" 10 #include "CCDrawQuad.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 TRACE_EVENT0("cc", "CCThreadProxy::postAnimationEventsToMainThreadOnImplThre ad"); 350 TRACE_EVENT0("cc", "CCThreadProxy::postAnimationEventsToMainThreadOnImplThre ad");
351 m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::setAnim ationEvents, events, wallClockTime)); 351 m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::setAnim ationEvents, events, wallClockTime));
352 } 352 }
353 353
354 void CCThreadProxy::releaseContentsTexturesOnImplThread() 354 void CCThreadProxy::releaseContentsTexturesOnImplThread()
355 { 355 {
356 ASSERT(isImplThread()); 356 ASSERT(isImplThread());
357 m_layerTreeHost->reduceContentsTexturesMemoryOnImplThread(0, m_layerTreeHost Impl->resourceProvider()); 357 m_layerTreeHost->reduceContentsTexturesMemoryOnImplThread(0, m_layerTreeHost Impl->resourceProvider());
358 // Make sure that we get a new commit before drawing again. 358 // Make sure that we get a new commit before drawing again.
359 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; 359 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false;
360 // The texture upload queue may reference textures that were just purged, so clear it. 360 // The texture upload queue may reference textures that were just purged, cl ear
361 m_currentTextureUpdateControllerOnImplThread.clear(); 361 // them from the queue.
362 if (m_currentTextureUpdateControllerOnImplThread.get() && m_layerTreeHost->e victedContentsTexturesBackingsExist())
363 m_currentTextureUpdateControllerOnImplThread->discardUploadsToEvictedRes ources();
362 } 364 }
363 365
364 void CCThreadProxy::setNeedsRedraw() 366 void CCThreadProxy::setNeedsRedraw()
365 { 367 {
366 ASSERT(isMainThread()); 368 ASSERT(isMainThread());
367 TRACE_EVENT0("cc", "CCThreadProxy::setNeedsRedraw"); 369 TRACE_EVENT0("cc", "CCThreadProxy::setNeedsRedraw");
368 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::set FullRootLayerDamageOnImplThread)); 370 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::set FullRootLayerDamageOnImplThread));
369 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::set NeedsRedrawOnImplThread)); 371 CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::set NeedsRedrawOnImplThread));
370 } 372 }
371 373
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 ASSERT(isImplThread() && isMainThreadBlocked()); 582 ASSERT(isImplThread() && isMainThreadBlocked());
581 ASSERT(m_schedulerOnImplThread); 583 ASSERT(m_schedulerOnImplThread);
582 ASSERT(m_schedulerOnImplThread->commitPending()); 584 ASSERT(m_schedulerOnImplThread->commitPending());
583 585
584 if (!m_layerTreeHostImpl) { 586 if (!m_layerTreeHostImpl) {
585 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree"); 587 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree");
586 completion->signal(); 588 completion->signal();
587 return; 589 return;
588 } 590 }
589 591
592 // Clear any uploads we were making to textures linked to evicted
593 // resources
594 if (m_layerTreeHost->evictedContentsTexturesBackingsExist())
595 queue->clearUploadsToEvictedResources();
596
590 // If we unlinked evicted textures on the main thread, delete them now. 597 // If we unlinked evicted textures on the main thread, delete them now.
591 if (m_layerTreeHost->deleteEvictedContentTexturesBackings()) { 598 if (m_layerTreeHost->deleteEvictedContentTexturesBackings()) {
592
593 // Deleting the evicted textures' backings resulted in some textures in the 599 // Deleting the evicted textures' backings resulted in some textures in the
594 // layer tree being invalidated (unliked from their backings). The uploa d queue 600 // layer tree being invalidated (unliked from their backings). Kick off
595 // may contain references to these textures, so clear the queue and kick off
596 // another commit to fill them again. 601 // another commit to fill them again.
597 queue->clearUploads();
598 setNeedsCommitOnImplThread(); 602 setNeedsCommitOnImplThread();
599 } else { 603 } else {
600 // The layer tree does not reference evicted textures, so mark that we 604 // The layer tree does not reference evicted textures, so mark that we
601 // can draw this tree once this commit is complete. 605 // can draw this tree once this commit is complete.
602 if (m_layerTreeHostImpl->contentsTexturesPurged()) 606 if (m_layerTreeHostImpl->contentsTexturesPurged())
603 m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; 607 m_resetContentsTexturesPurgedAfterCommitOnImplThread = true;
604 } 608 }
605 609
606 bool hasResourceUpdates = !!queue->fullUploadSize(); 610 bool hasResourceUpdates = !!queue->fullUploadSize();
607 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::cr eate(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider() , m_layerTreeHostImpl->resourceProvider()->textureUploader()); 611 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::cr eate(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider() , m_layerTreeHostImpl->resourceProvider()->textureUploader());
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 } 928 }
925 929
926 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple tion, CCRenderingStats* stats) 930 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple tion, CCRenderingStats* stats)
927 { 931 {
928 ASSERT(isImplThread()); 932 ASSERT(isImplThread());
929 m_layerTreeHostImpl->renderingStats(*stats); 933 m_layerTreeHostImpl->renderingStats(*stats);
930 completion->signal(); 934 completion->signal();
931 } 935 }
932 936
933 } // namespace cc 937 } // namespace cc
OLDNEW
« no previous file with comments | « cc/CCTextureUpdateQueue.cpp ('k') | cc/LayerTextureUpdater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698