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

Side by Side Diff: cc/thread_proxy.cc

Issue 11830040: cc: Do not request redraw on commit when impl-side painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_draw3
Patch Set: 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
« cc/scheduler_state_machine.cc ('K') | « cc/scheduler_state_machine.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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), 404 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(),
405 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes() , 405 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes() ,
406 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); 406 m_layerTreeHost->contentsTextureManager()->memoryUseBytes());
407 } 407 }
408 408
409 void ThreadProxy::setNeedsRedraw() 409 void ThreadProxy::setNeedsRedraw()
410 { 410 {
411 DCHECK(isMainThread()); 411 DCHECK(isMainThread());
412 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw"); 412 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw");
413 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setFullRootLayerDamag eOnImplThread, m_implThreadWeakPtr)); 413 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setFullRootLayerDamag eOnImplThread, m_implThreadWeakPtr));
414 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setNeedsRedrawOnImplT hread, m_implThreadWeakPtr)); 414 if (!m_layerTreeHost->settings().implSidePainting)
enne (OOO) 2013/01/10 03:45:31 I understand moving the conditional in the commit
nduca 2013/01/10 11:01:09 yeah this makes no sense to me
brianderson 2013/01/10 18:55:32 Ah, I saw this being called after a commit and ass
415 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setNeedsRedrawOnI mplThread, m_implThreadWeakPtr));
415 } 416 }
416 417
417 void ThreadProxy::setDeferCommits(bool deferCommits) 418 void ThreadProxy::setDeferCommits(bool deferCommits)
418 { 419 {
419 DCHECK(isMainThread()); 420 DCHECK(isMainThread());
420 DCHECK_NE(m_deferCommits, deferCommits); 421 DCHECK_NE(m_deferCommits, deferCommits);
421 m_deferCommits = deferCommits; 422 m_deferCommits = deferCommits;
422 423
423 if (m_deferCommits) 424 if (m_deferCommits)
424 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::setDeferCommits", this); 425 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::setDeferCommits", this);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 726
726 m_layerTreeHostImpl->commitComplete(); 727 m_layerTreeHostImpl->commitComplete();
727 728
728 m_nextFrameIsNewlyCommittedFrameOnImplThread = true; 729 m_nextFrameIsNewlyCommittedFrameOnImplThread = true;
729 730
730 m_commitCompletionEventOnImplThread->signal(); 731 m_commitCompletionEventOnImplThread->signal();
731 m_commitCompletionEventOnImplThread = 0; 732 m_commitCompletionEventOnImplThread = 0;
732 733
733 // SetVisible kicks off the next scheduler action, so this must be last. 734 // SetVisible kicks off the next scheduler action, so this must be last.
734 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); 735 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible());
736
nduca 2013/01/10 11:01:09 I dislike this. I'd rather this was all in the st
brianderson 2013/01/10 18:55:32 I had moved it out here because all the other setN
737 // This will also kick off the a scheduler action.
enne (OOO) 2013/01/10 03:45:31 Can you reconcile this with the previous comment t
738 if (!m_layerTreeHost->settings().implSidePainting)
739 m_schedulerOnImplThread->setNeedsRedraw();
enne (OOO) 2013/01/10 03:45:31 I feel like removing the redraw here needs to corr
brianderson 2013/01/10 18:55:32 This is meant to go on top of my other patch, whic
735 } 740 }
736 741
737 void ThreadProxy::scheduledActionBeginContextRecreation() 742 void ThreadProxy::scheduledActionBeginContextRecreation()
738 { 743 {
739 DCHECK(isImplThread()); 744 DCHECK(isImplThread());
740 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginContextRecreatio n, m_mainThreadWeakPtr)); 745 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginContextRecreatio n, m_mainThreadWeakPtr));
741 } 746 }
742 747
743 ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal (bool forcedDraw) 748 ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal (bool forcedDraw)
744 { 749 {
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } 1046 }
1042 1047
1043 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia:: RefPtr<SkPicture>* picture) 1048 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia:: RefPtr<SkPicture>* picture)
1044 { 1049 {
1045 DCHECK(isImplThread()); 1050 DCHECK(isImplThread());
1046 *picture = m_layerTreeHostImpl->capturePicture(); 1051 *picture = m_layerTreeHostImpl->capturePicture();
1047 completion->signal(); 1052 completion->signal();
1048 } 1053 }
1049 1054
1050 } // namespace cc 1055 } // namespace cc
OLDNEW
« cc/scheduler_state_machine.cc ('K') | « cc/scheduler_state_machine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698