Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index a27630eae962304101996d32155217ad1670dc6b..2ada7930aeadbf9c8b4701136959e5aff4da6d6a 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -537,7 +537,7 @@ void LayerTreeImpl::ClearViewportLayers() { |
outer_viewport_scroll_layer_ = NULL; |
} |
-bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) { |
+bool LayerTreeImpl::UpdateDrawProperties(bool first_update_after_commit) { |
if (!needs_update_draw_properties_) |
return true; |
@@ -662,8 +662,10 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) { |
// properties has not occurred yet and so it's not clear whether or not the |
// layer can or cannot use lcd text. So, this is the cleanup pass to |
// determine if the raster source needs to be replaced with a non-lcd |
- // raster source due to draw properties. |
- if (update_lcd_text) { |
+ // raster source due to draw properties. We also check for changes in the |
+ // viewport size here and if using GPU rasterization, notify the layers |
+ // that they need to recalculate the tiling texture size. |
+ if (first_update_after_commit) { |
// TODO(enne): Make LTHI::sync_tree return this value. |
LayerTreeImpl* sync_tree = |
layer_tree_host_impl_->proxy()->CommitToActiveTree() |
@@ -672,8 +674,16 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) { |
// If this is not the sync tree, then it is not safe to update lcd text |
// as it causes invalidations and the tiles may be in use. |
DCHECK_EQ(this, sync_tree); |
- for (const auto& layer : picture_layers_) |
+ |
+ bool layersNeedNotificationOfViewportChange = |
enne (OOO)
2015/03/19 17:55:24
layers_need_notification_etc
|
+ layer_tree_host_impl_->active_tree()->ViewportSizeInvalid() && |
enne (OOO)
2015/03/19 17:55:24
This will not work. If you commit to the active t
|
+ layer_tree_host_impl_->use_gpu_rasterization(); |
enne (OOO)
2015/03/19 17:55:24
This is leaking implementation details of PictureL
|
+ |
+ for (const auto& layer : picture_layers_) { |
layer->UpdateCanUseLCDTextAfterCommit(); |
+ if (layersNeedNotificationOfViewportChange) |
+ layer->UpdateViewportAfterCommit(); |
+ } |
} |
{ |
@@ -1474,8 +1484,8 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint( |
const gfx::PointF& screen_space_point) { |
if (!root_layer()) |
return NULL; |
- bool update_lcd_text = false; |
- if (!UpdateDrawProperties(update_lcd_text)) |
+ bool first_update_after_commit = false; |
+ if (!UpdateDrawProperties(first_update_after_commit)) |
return NULL; |
FindClosestMatchingLayerDataForRecursion data_for_recursion; |
FindClosestMatchingLayer(screen_space_point, |
@@ -1517,8 +1527,8 @@ LayerImpl* LayerTreeImpl::FindLayerWithWheelHandlerThatIsHitByPoint( |
const gfx::PointF& screen_space_point) { |
if (!root_layer()) |
return NULL; |
- bool update_lcd_text = false; |
- if (!UpdateDrawProperties(update_lcd_text)) |
+ bool first_update_after_commit = false; |
+ if (!UpdateDrawProperties(first_update_after_commit)) |
return NULL; |
FindWheelEventLayerFunctor func; |
FindClosestMatchingLayerDataForRecursion data_for_recursion; |
@@ -1538,8 +1548,8 @@ LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( |
const gfx::PointF& screen_space_point) { |
if (!root_layer()) |
return NULL; |
- bool update_lcd_text = false; |
- if (!UpdateDrawProperties(update_lcd_text)) |
+ bool first_update_after_commit = false; |
+ if (!UpdateDrawProperties(first_update_after_commit)) |
return NULL; |
FindTouchEventLayerFunctor func = {screen_space_point}; |
FindClosestMatchingLayerDataForRecursion data_for_recursion; |