Commit 665e60f5 authored by aelias's avatar aelias Committed by Commit bot

Fix incorrect padding size with NTP.

ContentLayer::ComputeSize() could return the wrong value when
can_use_live_layer is false because the live layer would be hidden by
detaching it from the parent layer.  That's not observable by
the early-returns in GetDrawsContentLeaf, so a full live layer size
could be returned, resulting in insufficient padding.  Switching to
HideLayerAndSubtree instead makes it observed by one early-return.

BUG=696977,699478

Review-Url: https://codereview.chromium.org/2739103004
Cr-Commit-Position: refs/heads/master@{#455999}
parent df6aab60
...@@ -64,9 +64,9 @@ void ContentLayer::SetProperties(int id, ...@@ -64,9 +64,9 @@ void ContentLayer::SetProperties(int id,
float saturation, float saturation,
bool should_clip, bool should_clip,
const gfx::Rect& clip) { const gfx::Rect& clip) {
scoped_refptr<cc::Layer> live_layer; scoped_refptr<cc::Layer> live_layer = tab_content_manager_->GetLiveLayer(id);
if (can_use_live_layer) if (live_layer)
live_layer = tab_content_manager_->GetLiveLayer(id); live_layer->SetHideLayerAndSubtree(!can_use_live_layer);
bool live_layer_draws = GetDrawsContentLeaf(live_layer); bool live_layer_draws = GetDrawsContentLeaf(live_layer);
scoped_refptr<ThumbnailLayer> static_layer = scoped_refptr<ThumbnailLayer> static_layer =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment