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

Side by Side Diff: cc/thread_proxy.cc

Issue 11886091: cc: Fix resource eviction with impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix enforceManagedMemoryPolicy. It's possible we have pending tree when this is called. Created 7 years, 11 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/single_thread_proxy.cc ('k') | no next file » | 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 "cc/thread_proxy.h" 5 #include "cc/thread_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/delay_based_time_source.h" 9 #include "cc/delay_based_time_source.h"
10 #include "cc/draw_quad.h" 10 #include "cc/draw_quad.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 { 697 {
698 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionCommit"); 698 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionCommit");
699 DCHECK(isImplThread()); 699 DCHECK(isImplThread());
700 DCHECK(m_commitCompletionEventOnImplThread); 700 DCHECK(m_commitCompletionEventOnImplThread);
701 DCHECK(m_currentResourceUpdateControllerOnImplThread); 701 DCHECK(m_currentResourceUpdateControllerOnImplThread);
702 702
703 // Complete all remaining texture updates. 703 // Complete all remaining texture updates.
704 m_currentResourceUpdateControllerOnImplThread->finalize(); 704 m_currentResourceUpdateControllerOnImplThread->finalize();
705 m_currentResourceUpdateControllerOnImplThread.reset(); 705 m_currentResourceUpdateControllerOnImplThread.reset();
706 706
707 // If there are linked evicted backings, these backings' resources may be pu t into the
708 // impl tree, so we can't draw yet. Determine this before clearing all evict ed backings.
709 bool newImplTreeHasNoEvictedResources = !m_layerTreeHost->contentsTextureMan ager()->linkedEvictedBackingsExist();
710
711 m_layerTreeHostImpl->beginCommit(); 707 m_layerTreeHostImpl->beginCommit();
712 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); 708 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
713 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); 709 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
714
715 if (newImplTreeHasNoEvictedResources) {
716 if (m_layerTreeHostImpl->contentsTexturesPurged())
717 m_layerTreeHostImpl->resetContentsTexturesPurged();
718 }
719
720 m_layerTreeHostImpl->commitComplete(); 710 m_layerTreeHostImpl->commitComplete();
721 711
722 m_nextFrameIsNewlyCommittedFrameOnImplThread = true; 712 m_nextFrameIsNewlyCommittedFrameOnImplThread = true;
723 713
724 if (m_layerTreeHost->settings().implSidePainting && m_layerTreeHost->blocksP endingCommit()) 714 if (m_layerTreeHost->settings().implSidePainting && m_layerTreeHost->blocksP endingCommit())
725 { 715 {
726 // For some layer types in impl-side painting, the commit is held until 716 // For some layer types in impl-side painting, the commit is held until
727 // the pending tree is activated. 717 // the pending tree is activated.
728 TRACE_EVENT_INSTANT0("cc", "HoldCommit"); 718 TRACE_EVENT_INSTANT0("cc", "HoldCommit");
729 m_completionEventForCommitHeldOnTreeActivation = m_commitCompletionEvent OnImplThread; 719 m_completionEventForCommitHeldOnTreeActivation = m_commitCompletionEvent OnImplThread;
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 } 1061 }
1072 1062
1073 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia:: RefPtr<SkPicture>* picture) 1063 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia:: RefPtr<SkPicture>* picture)
1074 { 1064 {
1075 DCHECK(isImplThread()); 1065 DCHECK(isImplThread());
1076 *picture = m_layerTreeHostImpl->capturePicture(); 1066 *picture = m_layerTreeHostImpl->capturePicture();
1077 completion->signal(); 1067 completion->signal();
1078 } 1068 }
1079 1069
1080 } // namespace cc 1070 } // namespace cc
OLDNEW
« no previous file with comments | « cc/single_thread_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698