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

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: fix [chromium-style] virtual methods with non-empty bodies shouldn't be declared inline 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
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('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 "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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 occlusionTracker.setNonOccludingScreenSpaceRectsContainer(&frame.nonOccl udingScreenSpaceRects); 467 occlusionTracker.setNonOccludingScreenSpaceRectsContainer(&frame.nonOccl udingScreenSpaceRects);
468 468
469 // Add quads to the Render passes in FrontToBack order to allow for testing occlusion and performing culling during the tree walk. 469 // Add quads to the Render passes in FrontToBack order to allow for testing occlusion and performing culling during the tree walk.
470 typedef LayerIterator<LayerImpl, std::vector<LayerImpl*>, RenderSurfaceImpl, LayerIteratorActions::FrontToBack> LayerIteratorType; 470 typedef LayerIterator<LayerImpl, std::vector<LayerImpl*>, RenderSurfaceImpl, LayerIteratorActions::FrontToBack> LayerIteratorType;
471 471
472 // Typically when we are missing a texture and use a checkerboard quad, we s till draw the frame. However when the layer being 472 // Typically when we are missing a texture and use a checkerboard quad, we s till draw the frame. However when the layer being
473 // checkerboarded is moving due to an impl-animation, we drop the frame to a void flashing due to the texture suddenly appearing 473 // checkerboarded is moving due to an impl-animation, we drop the frame to a void flashing due to the texture suddenly appearing
474 // in the future. 474 // in the future.
475 bool drawFrame = true; 475 bool drawFrame = true;
476 476
477 // Make sure we have the most recent info regarding which textures have been uploaded.
478 checkForCompletedSetPixels();
479
480 LayerIteratorType end = LayerIteratorType::end(frame.renderSurfaceLayerList) ; 477 LayerIteratorType end = LayerIteratorType::end(frame.renderSurfaceLayerList) ;
481 for (LayerIteratorType it = LayerIteratorType::begin(frame.renderSurfaceLaye rList); it != end; ++it) { 478 for (LayerIteratorType it = LayerIteratorType::begin(frame.renderSurfaceLaye rList); it != end; ++it) {
482 RenderPass::Id targetRenderPassId = it.targetRenderSurfaceLayer()->rende rSurface()->renderPassId(); 479 RenderPass::Id targetRenderPassId = it.targetRenderSurfaceLayer()->rende rSurface()->renderPassId();
483 RenderPass* targetRenderPass = frame.renderPassesById[targetRenderPassId ]; 480 RenderPass* targetRenderPass = frame.renderPassesById[targetRenderPassId ];
484 481
485 occlusionTracker.enterLayer(it); 482 occlusionTracker.enterLayer(it);
486 483
487 AppendQuadsData appendQuadsData(targetRenderPass->id); 484 AppendQuadsData appendQuadsData(targetRenderPass->id);
488 485
489 if (it.representsContributingRenderSurface()) { 486 if (it.representsContributingRenderSurface()) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 { 714 {
718 return m_proxy->hasImplThread(); 715 return m_proxy->hasImplThread();
719 } 716 }
720 717
721 void LayerTreeHostImpl::ScheduleManageTiles() 718 void LayerTreeHostImpl::ScheduleManageTiles()
722 { 719 {
723 if (m_client) 720 if (m_client)
724 m_client->setNeedsManageTilesOnImplThread(); 721 m_client->setNeedsManageTilesOnImplThread();
725 } 722 }
726 723
724 void LayerTreeHostImpl::DidUploadVisibleHighResolutionTile()
725 {
726 if (m_client)
727 m_client->didUploadVisibleHighResolutionTileOnImplTread();
728 }
729
727 bool LayerTreeHostImpl::shouldClearRootRenderPass() const 730 bool LayerTreeHostImpl::shouldClearRootRenderPass() const
728 { 731 {
729 return m_settings.shouldClearRootRenderPass; 732 return m_settings.shouldClearRootRenderPass;
730 } 733 }
731 734
732 void LayerTreeHostImpl::setManagedMemoryPolicy(const ManagedMemoryPolicy& policy ) 735 void LayerTreeHostImpl::setManagedMemoryPolicy(const ManagedMemoryPolicy& policy )
733 { 736 {
734 if (m_managedMemoryPolicy == policy) 737 if (m_managedMemoryPolicy == policy)
735 return; 738 return;
736 739
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 846 }
844 847
845 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const 848 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const
846 { 849 {
847 return m_renderer->capabilities(); 850 return m_renderer->capabilities();
848 } 851 }
849 852
850 bool LayerTreeHostImpl::swapBuffers() 853 bool LayerTreeHostImpl::swapBuffers()
851 { 854 {
852 DCHECK(m_renderer); 855 DCHECK(m_renderer);
853 return m_renderer->swapBuffers(); 856 bool result = m_renderer->swapBuffers();
857
858 if (m_settings.implSidePainting &&
859 !activeTree()->AreVisibleResourcesReady()) {
860 m_client->didSwapUseIncompleteTextureOnImplThread();
861 }
862
863 return result;
854 } 864 }
855 865
856 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const 866 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const
857 { 867 {
858 return m_deviceViewportSize; 868 return m_deviceViewportSize;
859 } 869 }
860 870
861 const LayerTreeSettings& LayerTreeHostImpl::settings() const 871 const LayerTreeSettings& LayerTreeHostImpl::settings() const
862 { 872 {
863 return m_settings; 873 return m_settings;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 } 927 }
918 928
919 void LayerTreeHostImpl::createPendingTree() 929 void LayerTreeHostImpl::createPendingTree()
920 { 930 {
921 CHECK(!m_pendingTree); 931 CHECK(!m_pendingTree);
922 m_pendingTree = LayerTreeImpl::create(this); 932 m_pendingTree = LayerTreeImpl::create(this);
923 m_client->onCanDrawStateChanged(canDraw()); 933 m_client->onCanDrawStateChanged(canDraw());
924 m_client->onHasPendingTreeStateChanged(pendingTree()); 934 m_client->onHasPendingTreeStateChanged(pendingTree());
925 } 935 }
926 936
927 void LayerTreeHostImpl::checkForCompletedSetPixels() 937 void LayerTreeHostImpl::checkForCompletedTextures()
928 { 938 {
939 DCHECK(!m_client->isInsideDraw()) << "Checking for completed textures within a draw may trigger spurious redraws.";
929 if (m_tileManager) 940 if (m_tileManager)
930 m_tileManager->CheckForCompletedSetPixels(); 941 m_tileManager->CheckForCompletedTextures();
931 } 942 }
932 943
933 void LayerTreeHostImpl::activatePendingTreeIfNeeded() 944 void LayerTreeHostImpl::activatePendingTreeIfNeeded()
934 { 945 {
935 if (!pendingTree()) 946 if (!pendingTree())
936 return; 947 return;
937 948
938 checkForCompletedSetPixels();
939
940 // It's always fine to activate to an empty tree. Otherwise, only 949 // It's always fine to activate to an empty tree. Otherwise, only
941 // activate once all visible resources in pending tree are ready. 950 // activate once all visible resources in pending tree are ready.
942 if (activeTree()->RootLayer() && 951 if (activeTree()->RootLayer() &&
943 !pendingTree()->AreVisibleResourcesReady()) 952 !pendingTree()->AreVisibleResourcesReady())
944 return; 953 return;
945 954
946 activatePendingTree(); 955 activatePendingTree();
947 } 956 }
948 957
949 void LayerTreeHostImpl::activatePendingTree() 958 void LayerTreeHostImpl::activatePendingTree()
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1683 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1675 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1684 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1676 } 1685 }
1677 1686
1678 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) 1687 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime)
1679 { 1688 {
1680 m_paintTimeCounter->SavePaintTime(totalPaintTime); 1689 m_paintTimeCounter->SavePaintTime(totalPaintTime);
1681 } 1690 }
1682 1691
1683 } // namespace cc 1692 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698