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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11879012: cc: Redraw incomplete frames when new texture uploads finish (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_draw3b
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
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/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const 830 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const
831 { 831 {
832 return m_renderer->capabilities(); 832 return m_renderer->capabilities();
833 } 833 }
834 834
835 bool LayerTreeHostImpl::swapBuffers() 835 bool LayerTreeHostImpl::swapBuffers()
836 { 836 {
837 DCHECK(m_renderer); 837 DCHECK(m_renderer);
838 838
839 m_fpsCounter->markEndOfFrame(); 839 m_fpsCounter->markEndOfFrame();
840 return m_renderer->swapBuffers(); 840 bool result = m_renderer->swapBuffers();
841
842 if (!activeTree()->AreVisibleResourcesReady()) {
843 m_client->setNeedsRedrawOnVisibleTextureUploadOnImplThread();
844 }
845
846 return result;
841 } 847 }
842 848
843 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const 849 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const
844 { 850 {
845 return m_deviceViewportSize; 851 return m_deviceViewportSize;
846 } 852 }
847 853
848 const LayerTreeSettings& LayerTreeHostImpl::settings() const 854 const LayerTreeSettings& LayerTreeHostImpl::settings() const
849 { 855 {
850 return m_settings; 856 return m_settings;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 } 905 }
900 906
901 void LayerTreeHostImpl::createPendingTree() 907 void LayerTreeHostImpl::createPendingTree()
902 { 908 {
903 CHECK(!m_pendingTree); 909 CHECK(!m_pendingTree);
904 m_pendingTree = LayerTreeImpl::create(this); 910 m_pendingTree = LayerTreeImpl::create(this);
905 m_client->onCanDrawStateChanged(canDraw()); 911 m_client->onCanDrawStateChanged(canDraw());
906 m_client->onHasPendingTreeStateChanged(pendingTree()); 912 m_client->onHasPendingTreeStateChanged(pendingTree());
907 } 913 }
908 914
909 void LayerTreeHostImpl::checkForCompletedSetPixels() 915 bool LayerTreeHostImpl::checkForCompletedSetPixels()
910 { 916 {
911 if (m_tileManager) 917 if (m_tileManager)
912 m_tileManager->CheckForCompletedSetPixels(); 918 return m_tileManager->CheckForCompletedSetPixels();
919 return false;
913 } 920 }
914 921
915 void LayerTreeHostImpl::activatePendingTreeIfNeeded() 922 void LayerTreeHostImpl::activatePendingTreeIfNeeded()
916 { 923 {
917 if (!pendingTree()) 924 if (!pendingTree())
918 return; 925 return;
919 926
920 checkForCompletedSetPixels(); 927 checkForCompletedSetPixels();
921 928
922 // It's always fine to activate to an empty tree. Otherwise, only 929 // It's always fine to activate to an empty tree. Otherwise, only
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 } 1646 }
1640 1647
1641 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() 1648 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture()
1642 { 1649 {
1643 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); 1650 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
1644 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1651 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1645 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1652 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1646 } 1653 }
1647 1654
1648 } // namespace cc 1655 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/scheduler.h » ('j') | cc/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698