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

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: 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
« no previous file with comments | « 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..b6fdb9550609433ea0e7367cd310fedda36bced9 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())
sohanjg 2014/04/01 12:03:11 we may optimize this check.
+ SetViewportDamage(rect);
+ else
+ SetFullRootLayerDamage();
+ tile_manager_->ResetDamagedRect();
+
if (client_ && !client_->IsInsideDraw())
client_->DidInitializeVisibleTileOnImplThread();
}
@@ -1592,8 +1599,9 @@ void LayerTreeHostImpl::CreatePendingTree() {
}
void LayerTreeHostImpl::UpdateVisibleTiles() {
- if (tile_manager_ && tile_manager_->UpdateVisibleTiles())
+ if (tile_manager_ && tile_manager_->UpdateVisibleTiles()) {
DidInitializeVisibleTile();
+ }
need_to_update_visible_tiles_before_draw_ = false;
}
« no previous file with comments | « cc/resources/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698