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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 219963005: cc: Add support for partial swaps when using impl-side painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP - optimize damage rect in LTHI Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« cc/resources/tile_manager.cc ('K') | « cc/resources/tile_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 072e8e7efbf2d6ae30186f8514e2d47b790961b8..90ac2f33806f04244949606caa64e97e3d25a0a2 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1195,7 +1195,14 @@ void LayerTreeHostImpl::DidModifyTilePriorities() {
void LayerTreeHostImpl::DidInitializeVisibleTile() {
// TODO(reveman): Determine tiles that changed and only damage
// what's necessary.
- SetFullRootLayerDamage();
+ gfx::Rect rect = tile_manager_->GetDamagedRect();
+ if (rect.width() * rect.height() <=
+ DrawViewportSize().width() * DrawViewportSize().height())
+ SetViewportDamage(rect);
+ else
+ SetFullRootLayerDamage();
+ tile_manager_->ResetDamagedRect();
+
if (client_ && !client_->IsInsideDraw())
client_->DidInitializeVisibleTileOnImplThread();
}
« cc/resources/tile_manager.cc ('K') | « cc/resources/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698