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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 671653005: SetNeedsRedraw directly when updating a visible tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/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 5e89bbeda7ebed65b7fb2dde7c04b8d84c2f968a..dd9e85c7f8f473f3bf83c55f9f6df00a02d1e78e 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1117,10 +1117,8 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
"SourceFrameNumber",
active_tree_->source_frame_number());
- if (need_to_update_visible_tiles_before_draw_ &&
- tile_manager_ && tile_manager_->UpdateVisibleTiles()) {
- DidInitializeVisibleTile();
- }
+ if (need_to_update_visible_tiles_before_draw_ && tile_manager_)
+ tile_manager_->UpdateVisibleTiles();
need_to_update_visible_tiles_before_draw_ = true;
UMA_HISTOGRAM_CUSTOM_COUNTS(
@@ -1269,8 +1267,8 @@ void LayerTreeHostImpl::DidModifyTilePriorities() {
}
void LayerTreeHostImpl::DidInitializeVisibleTile() {
- if (client_ && !client_->IsInsideDraw())
- client_->DidInitializeVisibleTileOnImplThread();
+ DCHECK(!client_->IsInsideDraw());
+ client_->DidInitializeVisibleTileOnImplThread();
}
void LayerTreeHostImpl::GetPictureLayerImplPairs(
@@ -1330,7 +1328,8 @@ void LayerTreeHostImpl::NotifyReadyToActivate() {
client_->NotifyReadyToActivate();
}
-void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) {
+void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile,
+ bool visible_tile) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileStateChanged");
if (active_tree_) {
@@ -1346,6 +1345,9 @@ void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) {
if (layer_impl)
layer_impl->NotifyTileStateChanged(tile);
}
+
+ if (visible_tile && !client_->IsInsideDraw())
enne (OOO) 2014/10/28 18:09:22 I don't think we want to redraw if a tile gets rem
danakj 2014/10/28 18:24:48 Ya.. though that's like flaky at best if you scrol
enne (OOO) 2014/10/28 18:47:33 No, it's true that it's flaky at best. But, it se
danakj 2014/10/31 20:02:01 Actually, I don't think I agree. If we're evicting
+ SetNeedsRedraw();
}
void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
@@ -2991,6 +2993,12 @@ void LayerTreeHostImpl::PinchGestureEnd() {
if (top_controls_manager_)
top_controls_manager_->PinchEnd();
client_->SetNeedsCommitOnImplThread();
+ // When a pinch ends, we may be displaying content cached at incorrect scales,
+ // so updating draw properties and drawing will ensure we are using the right
+ // scales that we want when we're not inside a pinch.
+ LOG(ERROR) << "END PINCH";
+ active_tree_->set_needs_update_draw_properties();
+ SetNeedsRedraw();
enne (OOO) 2014/10/28 18:09:21 Do you need the set needs redraw as well? Is this
enne (OOO) 2014/10/28 18:09:21 Do you need the set needs redraw as well? Is this
danakj 2014/10/28 18:24:48 We need this in order to trigger an UpdateDrawProp
enne (OOO) 2014/10/28 18:47:33 As I said elsewhere, the redraw part of that seems
danakj 2014/10/31 20:02:01 I think we agreed this is not racey. The Draw will
}
static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
« cc/resources/tile_manager.cc ('K') | « 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