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

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: resolve cc_unittests build error Created 6 years, 8 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/trees/layer_tree_host_impl.h ('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 108969dedc6d9ba0d18887361e174964473b85a6..3ed0aeebfffe76207ba59d15e1b4c94b33bde6fb 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1131,6 +1131,9 @@ void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) {
}
void LayerTreeHostImpl::DidInitializeVisibleTileForTesting() {
+ // Add arbitrary damage, to trigger prepare-to-draws.
+ // Here, setting damage as viewport size, used only for testing.
+ SetFullRootLayerDamage();
DidInitializeVisibleTile();
}
@@ -1206,9 +1209,6 @@ void LayerTreeHostImpl::DidModifyTilePriorities() {
}
void LayerTreeHostImpl::DidInitializeVisibleTile() {
- // TODO(reveman): Determine tiles that changed and only damage
- // what's necessary.
- SetFullRootLayerDamage();
if (client_ && !client_->IsInsideDraw())
client_->DidInitializeVisibleTileOnImplThread();
}
@@ -1217,6 +1217,19 @@ void LayerTreeHostImpl::NotifyReadyToActivate() {
client_->NotifyReadyToActivate();
}
+void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) {
+ if (!active_tree_)
+ return;
+
+ LayerImpl* layer_impl =
+ active_tree_->FindActiveTreeLayerById(tile->layer_id());
+ if (layer_impl) {
+ gfx::RectF layer_damage_rect =
+ gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale());
+ layer_impl->AddDamageRect(layer_damage_rect);
+ }
+}
+
void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
SetManagedMemoryPolicy(policy, zero_budget_);
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698