[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 1 | // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 5 | #include "cc/trees/layer_tree_impl.h" |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 6 | |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 7 | #include "base/debug/trace_event.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 8 | #include "cc/animation/keyframed_animation_curve.h" |
| 9 | #include "cc/animation/scrollbar_animation_controller.h" |
[email protected] | f6742f5 | 2013-05-08 23:52:22 | [diff] [blame] | 10 | #include "cc/debug/traced_value.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 11 | #include "cc/layers/heads_up_display_layer_impl.h" |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 12 | #include "cc/layers/render_surface_impl.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 13 | #include "cc/layers/scrollbar_layer_impl.h" |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 14 | #include "cc/trees/layer_tree_host_common.h" |
| 15 | #include "cc/trees/layer_tree_host_impl.h" |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 16 | #include "ui/gfx/size_conversions.h" |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 17 | #include "ui/gfx/vector2d_conversions.h" |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 18 | |
| 19 | namespace cc { |
| 20 | |
[email protected] | 8bef4057 | 2012-12-11 21:38:08 | [diff] [blame] | 21 | LayerTreeImpl::LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl) |
[email protected] | db8259f | 2013-02-01 05:25:04 | [diff] [blame] | 22 | : layer_tree_host_impl_(layer_tree_host_impl), |
| 23 | source_frame_number_(-1), |
| 24 | hud_layer_(0), |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 25 | root_scroll_layer_(NULL), |
| 26 | currently_scrolling_layer_(NULL), |
| 27 | root_layer_scroll_offset_delegate_(NULL), |
[email protected] | db8259f | 2013-02-01 05:25:04 | [diff] [blame] | 28 | background_color_(0), |
| 29 | has_transparent_background_(false), |
| 30 | page_scale_factor_(1), |
| 31 | page_scale_delta_(1), |
| 32 | sent_page_scale_delta_(1), |
| 33 | min_page_scale_factor_(0), |
| 34 | max_page_scale_factor_(0), |
| 35 | scrolling_layer_id_from_previous_tree_(0), |
| 36 | contents_textures_purged_(false), |
[email protected] | 31882285 | 2013-02-14 00:54:27 | [diff] [blame] | 37 | viewport_size_invalid_(false), |
[email protected] | db8259f | 2013-02-01 05:25:04 | [diff] [blame] | 38 | needs_update_draw_properties_(true), |
| 39 | needs_full_tree_sync_(true) { |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | LayerTreeImpl::~LayerTreeImpl() { |
[email protected] | 361bc00d | 2012-12-14 07:03:24 | [diff] [blame] | 43 | // Need to explicitly clear the tree prior to destroying this so that |
| 44 | // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. |
| 45 | root_layer_.reset(); |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 46 | } |
| 47 | |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 48 | static LayerImpl* FindRootScrollLayerRecursive(LayerImpl* layer) { |
| 49 | if (!layer) |
| 50 | return NULL; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 51 | |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 52 | if (layer->scrollable()) |
| 53 | return layer; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 54 | |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 55 | for (size_t i = 0; i < layer->children().size(); ++i) { |
| 56 | LayerImpl* found = FindRootScrollLayerRecursive(layer->children()[i]); |
| 57 | if (found) |
| 58 | return found; |
| 59 | } |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 60 | |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 61 | return NULL; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) { |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 65 | if (root_scroll_layer_) |
| 66 | root_scroll_layer_->SetScrollOffsetDelegate(NULL); |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 67 | root_layer_ = layer.Pass(); |
[email protected] | 5c4824e1 | 2013-01-12 16:34:53 | [diff] [blame] | 68 | currently_scrolling_layer_ = NULL; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 69 | root_scroll_layer_ = NULL; |
[email protected] | 5c4824e1 | 2013-01-12 16:34:53 | [diff] [blame] | 70 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 71 | layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
[email protected] | 5c4824e1 | 2013-01-12 16:34:53 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | void LayerTreeImpl::FindRootScrollLayer() { |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 75 | root_scroll_layer_ = FindRootScrollLayerRecursive(root_layer_.get()); |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 76 | |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 77 | if (root_scroll_layer_) { |
| 78 | root_scroll_layer_->SetScrollOffsetDelegate( |
| 79 | root_layer_scroll_offset_delegate_); |
| 80 | } |
| 81 | |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 82 | if (root_layer_ && scrolling_layer_id_from_previous_tree_) { |
[email protected] | 6ba91412 | 2013-03-22 16:26:39 | [diff] [blame] | 83 | currently_scrolling_layer_ = LayerTreeHostCommon::FindLayerInSubtree( |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 84 | root_layer_.get(), |
| 85 | scrolling_layer_id_from_previous_tree_); |
| 86 | } |
| 87 | |
| 88 | scrolling_layer_id_from_previous_tree_ = 0; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() { |
| 92 | // Clear all data structures that have direct references to the layer tree. |
| 93 | scrolling_layer_id_from_previous_tree_ = |
| 94 | currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 95 | if (root_scroll_layer_) |
| 96 | root_scroll_layer_->SetScrollOffsetDelegate(NULL); |
[email protected] | 69b50ec | 2013-01-19 04:58:01 | [diff] [blame] | 97 | root_scroll_layer_ = NULL; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 98 | currently_scrolling_layer_ = NULL; |
| 99 | |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 100 | render_surface_layer_list_.clear(); |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 101 | set_needs_update_draw_properties(); |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 102 | return root_layer_.Pass(); |
| 103 | } |
| 104 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 105 | void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
[email protected] | e4c3c87a | 2013-04-22 02:28:40 | [diff] [blame] | 106 | target_tree->SetLatencyInfo(latency_info_); |
| 107 | latency_info_.Clear(); |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 108 | target_tree->SetPageScaleFactorAndLimits( |
| 109 | page_scale_factor(), min_page_scale_factor(), max_page_scale_factor()); |
| 110 | target_tree->SetPageScaleDelta( |
| 111 | target_tree->page_scale_delta() / target_tree->sent_page_scale_delta()); |
| 112 | target_tree->set_sent_page_scale_delta(1); |
| 113 | |
| 114 | // This should match the property synchronization in |
| 115 | // LayerTreeHost::finishCommitOnImplThread(). |
| 116 | target_tree->set_source_frame_number(source_frame_number()); |
| 117 | target_tree->set_background_color(background_color()); |
| 118 | target_tree->set_has_transparent_background(has_transparent_background()); |
| 119 | |
| 120 | if (ContentsTexturesPurged()) |
| 121 | target_tree->SetContentsTexturesPurged(); |
| 122 | else |
| 123 | target_tree->ResetContentsTexturesPurged(); |
| 124 | |
[email protected] | 31882285 | 2013-02-14 00:54:27 | [diff] [blame] | 125 | if (ViewportSizeInvalid()) |
| 126 | target_tree->SetViewportSizeInvalid(); |
| 127 | else |
| 128 | target_tree->ResetViewportSizeInvalid(); |
| 129 | |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 130 | if (hud_layer()) |
| 131 | target_tree->set_hud_layer(static_cast<HeadsUpDisplayLayerImpl*>( |
[email protected] | 6ba91412 | 2013-03-22 16:26:39 | [diff] [blame] | 132 | LayerTreeHostCommon::FindLayerInSubtree( |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 133 | target_tree->root_layer(), hud_layer()->id()))); |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 134 | else |
| 135 | target_tree->set_hud_layer(NULL); |
| 136 | } |
| 137 | |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 138 | LayerImpl* LayerTreeImpl::RootScrollLayer() const { |
[email protected] | 69b50ec | 2013-01-19 04:58:01 | [diff] [blame] | 139 | DCHECK(IsActiveTree()); |
| 140 | return root_scroll_layer_; |
| 141 | } |
| 142 | |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 143 | LayerImpl* LayerTreeImpl::RootClipLayer() const { |
| 144 | return root_scroll_layer_ ? root_scroll_layer_->parent() : NULL; |
| 145 | } |
| 146 | |
| 147 | LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const { |
[email protected] | 69b50ec | 2013-01-19 04:58:01 | [diff] [blame] | 148 | DCHECK(IsActiveTree()); |
| 149 | return currently_scrolling_layer_; |
| 150 | } |
| 151 | |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 152 | void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) { |
| 153 | if (currently_scrolling_layer_ == layer) |
| 154 | return; |
| 155 | |
| 156 | if (currently_scrolling_layer_ && |
| 157 | currently_scrolling_layer_->scrollbar_animation_controller()) |
[email protected] | 6bc09e8 | 2013-03-19 03:48:35 | [diff] [blame] | 158 | currently_scrolling_layer_->scrollbar_animation_controller()-> |
[email protected] | fb7425a | 2013-04-22 16:28:55 | [diff] [blame] | 159 | DidScrollGestureEnd(CurrentFrameTimeTicks()); |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 160 | currently_scrolling_layer_ = layer; |
| 161 | if (layer && layer->scrollbar_animation_controller()) |
[email protected] | 6bc09e8 | 2013-03-19 03:48:35 | [diff] [blame] | 162 | layer->scrollbar_animation_controller()->DidScrollGestureBegin(); |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 163 | } |
| 164 | |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 165 | void LayerTreeImpl::ClearCurrentlyScrollingLayer() { |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 166 | SetCurrentlyScrollingLayer(NULL); |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 167 | scrolling_layer_id_from_previous_tree_ = 0; |
| 168 | } |
| 169 | |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 170 | void LayerTreeImpl::SetPageScaleFactorAndLimits(float page_scale_factor, |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 171 | float min_page_scale_factor, float max_page_scale_factor) { |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 172 | if (!page_scale_factor) |
| 173 | return; |
| 174 | |
| 175 | min_page_scale_factor_ = min_page_scale_factor; |
| 176 | max_page_scale_factor_ = max_page_scale_factor; |
| 177 | page_scale_factor_ = page_scale_factor; |
| 178 | } |
| 179 | |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 180 | void LayerTreeImpl::SetPageScaleDelta(float delta) { |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 181 | // Clamp to the current min/max limits. |
| 182 | float total = page_scale_factor_ * delta; |
| 183 | if (min_page_scale_factor_ && total < min_page_scale_factor_) |
| 184 | delta = min_page_scale_factor_ / page_scale_factor_; |
| 185 | else if (max_page_scale_factor_ && total > max_page_scale_factor_) |
| 186 | delta = max_page_scale_factor_ / page_scale_factor_; |
| 187 | |
| 188 | if (delta == page_scale_delta_) |
| 189 | return; |
| 190 | |
| 191 | page_scale_delta_ = delta; |
| 192 | |
| 193 | if (IsActiveTree()) { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 194 | LayerTreeImpl* pending_tree = layer_tree_host_impl_->pending_tree(); |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 195 | if (pending_tree) { |
| 196 | DCHECK_EQ(1, pending_tree->sent_page_scale_delta()); |
[email protected] | ca2902e9 | 2013-03-28 01:45:35 | [diff] [blame] | 197 | pending_tree->SetPageScaleDelta( |
| 198 | page_scale_delta_ / sent_page_scale_delta_); |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 199 | } |
| 200 | } |
| 201 | |
| 202 | UpdateMaxScrollOffset(); |
| 203 | set_needs_update_draw_properties(); |
| 204 | } |
| 205 | |
[email protected] | 257abfa8 | 2013-01-29 23:47:24 | [diff] [blame] | 206 | gfx::SizeF LayerTreeImpl::ScrollableViewportSize() const { |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 207 | return gfx::ScaleSize(layer_tree_host_impl_->VisibleViewportSize(), |
| 208 | 1.0f / total_page_scale_factor()); |
[email protected] | 257abfa8 | 2013-01-29 23:47:24 | [diff] [blame] | 209 | } |
| 210 | |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 211 | void LayerTreeImpl::UpdateMaxScrollOffset() { |
[email protected] | 69b50ec | 2013-01-19 04:58:01 | [diff] [blame] | 212 | if (!root_scroll_layer_ || !root_scroll_layer_->children().size()) |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 213 | return; |
| 214 | |
[email protected] | 42ccdbef | 2013-01-21 07:54:54 | [diff] [blame] | 215 | gfx::Vector2dF max_scroll = gfx::Rect(ScrollableSize()).bottom_right() - |
[email protected] | 257abfa8 | 2013-01-29 23:47:24 | [diff] [blame] | 216 | gfx::RectF(ScrollableViewportSize()).bottom_right(); |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 217 | |
| 218 | // The viewport may be larger than the contents in some cases, such as |
| 219 | // having a vertical scrollbar but no horizontal overflow. |
| 220 | max_scroll.ClampToMin(gfx::Vector2dF()); |
| 221 | |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 222 | root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll)); |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 223 | } |
| 224 | |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 225 | void LayerTreeImpl::UpdateSolidColorScrollbars() { |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 226 | DCHECK(settings().solid_color_scrollbars); |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 227 | |
| 228 | LayerImpl* root_scroll = RootScrollLayer(); |
[email protected] | ab5f4a9 | 2013-03-19 20:08:24 | [diff] [blame] | 229 | DCHECK(root_scroll); |
| 230 | DCHECK(IsActiveTree()); |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 231 | |
| 232 | gfx::RectF scrollable_viewport( |
| 233 | gfx::PointAtOffsetFromOrigin(root_scroll->TotalScrollOffset()), |
| 234 | ScrollableViewportSize()); |
| 235 | float vertical_adjust = 0.0f; |
| 236 | if (RootClipLayer()) |
| 237 | vertical_adjust = layer_tree_host_impl_->VisibleViewportSize().height() - |
| 238 | RootClipLayer()->bounds().height(); |
| 239 | if (ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer()) { |
| 240 | horiz->set_vertical_adjust(vertical_adjust); |
| 241 | horiz->SetViewportWithinScrollableArea(scrollable_viewport, |
| 242 | ScrollableSize()); |
| 243 | } |
| 244 | if (ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer()) { |
| 245 | vertical->set_vertical_adjust(vertical_adjust); |
| 246 | vertical->SetViewportWithinScrollableArea(scrollable_viewport, |
| 247 | ScrollableSize()); |
| 248 | } |
| 249 | } |
| 250 | |
[email protected] | 7d19dc34 | 2013-05-02 22:02:04 | [diff] [blame] | 251 | void LayerTreeImpl::UpdateDrawProperties() { |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 252 | if (IsActiveTree() && RootScrollLayer() && RootClipLayer()) |
| 253 | UpdateRootScrollLayerSizeDelta(); |
| 254 | |
[email protected] | ca2902e9 | 2013-03-28 01:45:35 | [diff] [blame] | 255 | if (settings().solid_color_scrollbars && |
| 256 | IsActiveTree() && |
| 257 | RootScrollLayer()) { |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 258 | UpdateSolidColorScrollbars(); |
| 259 | |
| 260 | // The top controls manager is incompatible with the WebKit-created cliprect |
| 261 | // because it can bring into view a larger amount of content when it |
| 262 | // hides. It's safe to deactivate the clip rect if no non-overlay scrollbars |
| 263 | // are present. |
[email protected] | ab5f4a9 | 2013-03-19 20:08:24 | [diff] [blame] | 264 | if (RootClipLayer() && layer_tree_host_impl_->top_controls_manager()) |
| 265 | RootClipLayer()->SetMasksToBounds(false); |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 266 | } |
| 267 | |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 268 | needs_update_draw_properties_ = false; |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 269 | render_surface_layer_list_.clear(); |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 270 | |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 271 | // For max_texture_size. |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 272 | if (!layer_tree_host_impl_->renderer()) |
| 273 | return; |
| 274 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 275 | if (!root_layer()) |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 276 | return; |
| 277 | |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 278 | { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 279 | TRACE_EVENT1("cc", |
| 280 | "LayerTreeImpl::UpdateDrawProperties", |
| 281 | "IsActive", |
| 282 | IsActiveTree()); |
[email protected] | 6ba91412 | 2013-03-22 16:26:39 | [diff] [blame] | 283 | LayerTreeHostCommon::CalculateDrawProperties( |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 284 | root_layer(), |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 285 | device_viewport_size(), |
| 286 | device_scale_factor(), |
[email protected] | c6027947 | 2013-01-30 12:10:51 | [diff] [blame] | 287 | total_page_scale_factor(), |
[email protected] | f213626 | 2013-04-26 21:10:19 | [diff] [blame] | 288 | root_scroll_layer_, |
[email protected] | f677653 | 2012-12-21 20:24:33 | [diff] [blame] | 289 | MaxTextureSize(), |
[email protected] | 8e0176d | 2013-03-21 03:14:52 | [diff] [blame] | 290 | settings().can_use_lcd_text, |
[email protected] | 35a99a1 | 2013-05-09 23:52:29 | [diff] [blame] | 291 | settings().layer_transforms_should_scale_layer_contents, |
[email protected] | 7d19dc34 | 2013-05-02 22:02:04 | [diff] [blame] | 292 | &render_surface_layer_list_); |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 293 | } |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 294 | |
| 295 | DCHECK(!needs_update_draw_properties_) << |
[email protected] | 7d19dc34 | 2013-05-02 22:02:04 | [diff] [blame] | 296 | "CalcDrawProperties should not set_needs_update_draw_properties()"; |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 297 | } |
| 298 | |
[email protected] | 3c0a325 | 2013-03-18 04:24:36 | [diff] [blame] | 299 | static void ClearRenderSurfacesOnLayerImplRecursive(LayerImpl* current) { |
| 300 | DCHECK(current); |
| 301 | for (size_t i = 0; i < current->children().size(); ++i) |
| 302 | ClearRenderSurfacesOnLayerImplRecursive(current->children()[i]); |
| 303 | current->ClearRenderSurface(); |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | void LayerTreeImpl::ClearRenderSurfaces() { |
[email protected] | 2a61ad5 | 2013-05-13 14:01:29 | [diff] [blame] | 307 | if (root_layer() == NULL) { |
| 308 | DCHECK(render_surface_layer_list_.empty()); |
| 309 | return; |
| 310 | } |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 311 | ClearRenderSurfacesOnLayerImplRecursive(root_layer()); |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 312 | render_surface_layer_list_.clear(); |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 313 | set_needs_update_draw_properties(); |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 314 | } |
| 315 | |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 316 | const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 317 | // If this assert triggers, then the list is dirty. |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 318 | DCHECK(!needs_update_draw_properties_); |
[email protected] | 76ffd9e | 2012-12-20 19:12:47 | [diff] [blame] | 319 | return render_surface_layer_list_; |
| 320 | } |
| 321 | |
[email protected] | 42ccdbef | 2013-01-21 07:54:54 | [diff] [blame] | 322 | gfx::Size LayerTreeImpl::ScrollableSize() const { |
[email protected] | c4d467a | 2013-01-21 03:21:01 | [diff] [blame] | 323 | if (!root_scroll_layer_ || root_scroll_layer_->children().empty()) |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 324 | return gfx::Size(); |
[email protected] | c4d467a | 2013-01-21 03:21:01 | [diff] [blame] | 325 | return root_scroll_layer_->children()[0]->bounds(); |
[email protected] | caa567d | 2012-12-20 07:56:16 | [diff] [blame] | 326 | } |
| 327 | |
[email protected] | 361bc00d | 2012-12-14 07:03:24 | [diff] [blame] | 328 | LayerImpl* LayerTreeImpl::LayerById(int id) { |
| 329 | LayerIdMap::iterator iter = layer_id_map_.find(id); |
| 330 | return iter != layer_id_map_.end() ? iter->second : NULL; |
| 331 | } |
| 332 | |
| 333 | void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
| 334 | DCHECK(!LayerById(layer->id())); |
| 335 | layer_id_map_[layer->id()] = layer; |
| 336 | } |
| 337 | |
| 338 | void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { |
| 339 | DCHECK(LayerById(layer->id())); |
| 340 | layer_id_map_.erase(layer->id()); |
| 341 | } |
| 342 | |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 343 | void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) { |
[email protected] | 1e0f8d6 | 2013-01-09 07:41:35 | [diff] [blame] | 344 | int id = currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0; |
[email protected] | 2a61ad5 | 2013-05-13 14:01:29 | [diff] [blame] | 345 | LayerImpl* pending_scrolling_layer_twin = NULL; |
| 346 | if (pending_tree->root_layer()) { |
| 347 | pending_scrolling_layer_twin = |
| 348 | LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), id); |
| 349 | } |
| 350 | pending_tree->SetCurrentlyScrollingLayer(pending_scrolling_layer_twin); |
[email protected] | 1e0f8d6 | 2013-01-09 07:41:35 | [diff] [blame] | 351 | } |
| 352 | |
[email protected] | 37386f05 | 2013-01-13 00:42:22 | [diff] [blame] | 353 | static void DidBecomeActiveRecursive(LayerImpl* layer) { |
[email protected] | 7aba666 | 2013-03-12 10:17:34 | [diff] [blame] | 354 | layer->DidBecomeActive(); |
[email protected] | 37386f05 | 2013-01-13 00:42:22 | [diff] [blame] | 355 | for (size_t i = 0; i < layer->children().size(); ++i) |
| 356 | DidBecomeActiveRecursive(layer->children()[i]); |
| 357 | } |
| 358 | |
| 359 | void LayerTreeImpl::DidBecomeActive() { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 360 | if (root_layer()) |
| 361 | DidBecomeActiveRecursive(root_layer()); |
[email protected] | 69b50ec | 2013-01-19 04:58:01 | [diff] [blame] | 362 | FindRootScrollLayer(); |
| 363 | UpdateMaxScrollOffset(); |
[email protected] | 37386f05 | 2013-01-13 00:42:22 | [diff] [blame] | 364 | } |
| 365 | |
[email protected] | 6f90b9e | 2013-01-17 23:42:00 | [diff] [blame] | 366 | bool LayerTreeImpl::ContentsTexturesPurged() const { |
| 367 | return contents_textures_purged_; |
| 368 | } |
| 369 | |
| 370 | void LayerTreeImpl::SetContentsTexturesPurged() { |
| 371 | contents_textures_purged_ = true; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 372 | layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
[email protected] | 6f90b9e | 2013-01-17 23:42:00 | [diff] [blame] | 373 | } |
| 374 | |
| 375 | void LayerTreeImpl::ResetContentsTexturesPurged() { |
| 376 | contents_textures_purged_ = false; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 377 | layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
[email protected] | 6f90b9e | 2013-01-17 23:42:00 | [diff] [blame] | 378 | } |
| 379 | |
[email protected] | 31882285 | 2013-02-14 00:54:27 | [diff] [blame] | 380 | bool LayerTreeImpl::ViewportSizeInvalid() const { |
| 381 | return viewport_size_invalid_; |
| 382 | } |
| 383 | |
| 384 | void LayerTreeImpl::SetViewportSizeInvalid() { |
| 385 | viewport_size_invalid_ = true; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 386 | layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
[email protected] | 31882285 | 2013-02-14 00:54:27 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | void LayerTreeImpl::ResetViewportSizeInvalid() { |
| 390 | viewport_size_invalid_ = false; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 391 | layer_tree_host_impl_->OnCanDrawStateChangedForTree(); |
[email protected] | 31882285 | 2013-02-14 00:54:27 | [diff] [blame] | 392 | } |
| 393 | |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 394 | Proxy* LayerTreeImpl::proxy() const { |
| 395 | return layer_tree_host_impl_->proxy(); |
| 396 | } |
| 397 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 398 | const LayerTreeSettings& LayerTreeImpl::settings() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 399 | return layer_tree_host_impl_->settings(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 400 | } |
| 401 | |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 402 | const RendererCapabilities& LayerTreeImpl::GetRendererCapabilities() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 403 | return layer_tree_host_impl_->GetRendererCapabilities(); |
[email protected] | bf5b3a0 | 2013-02-13 02:02:52 | [diff] [blame] | 404 | } |
| 405 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 406 | OutputSurface* LayerTreeImpl::output_surface() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 407 | return layer_tree_host_impl_->output_surface(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 408 | } |
| 409 | |
| 410 | ResourceProvider* LayerTreeImpl::resource_provider() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 411 | return layer_tree_host_impl_->resource_provider(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 412 | } |
| 413 | |
| 414 | TileManager* LayerTreeImpl::tile_manager() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 415 | return layer_tree_host_impl_->tile_manager(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 416 | } |
| 417 | |
| 418 | FrameRateCounter* LayerTreeImpl::frame_rate_counter() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 419 | return layer_tree_host_impl_->fps_counter(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 420 | } |
| 421 | |
[email protected] | 71691c2 | 2013-01-18 03:14:22 | [diff] [blame] | 422 | PaintTimeCounter* LayerTreeImpl::paint_time_counter() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 423 | return layer_tree_host_impl_->paint_time_counter(); |
[email protected] | 71691c2 | 2013-01-18 03:14:22 | [diff] [blame] | 424 | } |
| 425 | |
[email protected] | 1191d9d | 2013-02-02 06:00:33 | [diff] [blame] | 426 | MemoryHistory* LayerTreeImpl::memory_history() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 427 | return layer_tree_host_impl_->memory_history(); |
[email protected] | 1191d9d | 2013-02-02 06:00:33 | [diff] [blame] | 428 | } |
| 429 | |
[email protected] | f117a4c | 2012-12-16 04:53:10 | [diff] [blame] | 430 | bool LayerTreeImpl::IsActiveTree() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 431 | return layer_tree_host_impl_->active_tree() == this; |
[email protected] | f117a4c | 2012-12-16 04:53:10 | [diff] [blame] | 432 | } |
| 433 | |
| 434 | bool LayerTreeImpl::IsPendingTree() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 435 | return layer_tree_host_impl_->pending_tree() == this; |
[email protected] | f117a4c | 2012-12-16 04:53:10 | [diff] [blame] | 436 | } |
| 437 | |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 438 | bool LayerTreeImpl::IsRecycleTree() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 439 | return layer_tree_host_impl_->recycle_tree() == this; |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 440 | } |
| 441 | |
[email protected] | f117a4c | 2012-12-16 04:53:10 | [diff] [blame] | 442 | LayerImpl* LayerTreeImpl::FindActiveTreeLayerById(int id) { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 443 | LayerTreeImpl* tree = layer_tree_host_impl_->active_tree(); |
[email protected] | f117a4c | 2012-12-16 04:53:10 | [diff] [blame] | 444 | if (!tree) |
| 445 | return NULL; |
| 446 | return tree->LayerById(id); |
| 447 | } |
| 448 | |
| 449 | LayerImpl* LayerTreeImpl::FindPendingTreeLayerById(int id) { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 450 | LayerTreeImpl* tree = layer_tree_host_impl_->pending_tree(); |
[email protected] | f117a4c | 2012-12-16 04:53:10 | [diff] [blame] | 451 | if (!tree) |
| 452 | return NULL; |
| 453 | return tree->LayerById(id); |
| 454 | } |
| 455 | |
[email protected] | f677653 | 2012-12-21 20:24:33 | [diff] [blame] | 456 | int LayerTreeImpl::MaxTextureSize() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 457 | return layer_tree_host_impl_->GetRendererCapabilities().max_texture_size; |
[email protected] | f677653 | 2012-12-21 20:24:33 | [diff] [blame] | 458 | } |
| 459 | |
[email protected] | 166db5c8 | 2013-01-09 23:54:31 | [diff] [blame] | 460 | bool LayerTreeImpl::PinchGestureActive() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 461 | return layer_tree_host_impl_->pinch_gesture_active(); |
[email protected] | 166db5c8 | 2013-01-09 23:54:31 | [diff] [blame] | 462 | } |
| 463 | |
[email protected] | fb7425a | 2013-04-22 16:28:55 | [diff] [blame] | 464 | base::TimeTicks LayerTreeImpl::CurrentFrameTimeTicks() const { |
| 465 | return layer_tree_host_impl_->CurrentFrameTimeTicks(); |
| 466 | } |
| 467 | |
| 468 | base::Time LayerTreeImpl::CurrentFrameTime() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 469 | return layer_tree_host_impl_->CurrentFrameTime(); |
[email protected] | 829ad97 | 2013-01-28 23:36:10 | [diff] [blame] | 470 | } |
| 471 | |
[email protected] | d7eb8c7 | 2013-03-23 22:57:13 | [diff] [blame] | 472 | void LayerTreeImpl::SetNeedsCommit() { |
| 473 | layer_tree_host_impl_->SetNeedsCommit(); |
| 474 | } |
| 475 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 476 | void LayerTreeImpl::SetNeedsRedraw() { |
[email protected] | 59adb11 | 2013-04-09 04:48:44 | [diff] [blame] | 477 | layer_tree_host_impl_->SetNeedsRedraw(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 478 | } |
| 479 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 480 | const LayerTreeDebugState& LayerTreeImpl::debug_state() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 481 | return layer_tree_host_impl_->debug_state(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | float LayerTreeImpl::device_scale_factor() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 485 | return layer_tree_host_impl_->device_scale_factor(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 486 | } |
| 487 | |
[email protected] | 90ec987 | 2013-03-08 02:28:18 | [diff] [blame] | 488 | gfx::Size LayerTreeImpl::device_viewport_size() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 489 | return layer_tree_host_impl_->device_viewport_size(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 490 | } |
| 491 | |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 492 | std::string LayerTreeImpl::layer_tree_as_text() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 493 | return layer_tree_host_impl_->LayerTreeAsText(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 494 | } |
| 495 | |
| 496 | DebugRectHistory* LayerTreeImpl::debug_rect_history() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 497 | return layer_tree_host_impl_->debug_rect_history(); |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 498 | } |
| 499 | |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 500 | AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 501 | return layer_tree_host_impl_->animation_registrar(); |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 502 | } |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 503 | |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 504 | scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { |
[email protected] | f6742f5 | 2013-05-08 23:52:22 | [diff] [blame] | 505 | scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 506 | TracedValue::MakeDictIntoImplicitSnapshot( |
| 507 | state.get(), "cc::LayerTreeImpl", this); |
| 508 | |
| 509 | state->Set("root_layer", root_layer_->AsValue().release()); |
| 510 | |
| 511 | scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 512 | typedef LayerIterator<LayerImpl, |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 513 | LayerImplList, |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 514 | RenderSurfaceImpl, |
| 515 | LayerIteratorActions::BackToFront> LayerIteratorType; |
[email protected] | 71dfcc7 | 2013-03-20 21:30:09 | [diff] [blame] | 516 | LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 517 | for (LayerIteratorType it = LayerIteratorType::Begin( |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 518 | &render_surface_layer_list_); it != end; ++it) { |
[email protected] | 71dfcc7 | 2013-03-20 21:30:09 | [diff] [blame] | 519 | if (!it.represents_itself()) |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 520 | continue; |
[email protected] | f6742f5 | 2013-05-08 23:52:22 | [diff] [blame] | 521 | render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 522 | } |
[email protected] | f6742f5 | 2013-05-08 23:52:22 | [diff] [blame] | 523 | |
| 524 | state->Set("render_surface_layer_list", |
| 525 | render_surface_layer_list.release()); |
[email protected] | 8c569022 | 2013-02-15 17:36:43 | [diff] [blame] | 526 | return state.PassAs<base::Value>(); |
| 527 | } |
| 528 | |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 529 | void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
| 530 | LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { |
| 531 | root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; |
| 532 | if (root_scroll_layer_) { |
| 533 | root_scroll_layer_->SetScrollOffsetDelegate( |
| 534 | root_layer_scroll_offset_delegate_); |
| 535 | } |
| 536 | } |
| 537 | |
[email protected] | fe956c9c4 | 2013-04-09 04:26:33 | [diff] [blame] | 538 | void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() { |
| 539 | LayerImpl* root_scroll = RootScrollLayer(); |
| 540 | LayerImpl* root_clip = RootClipLayer(); |
| 541 | DCHECK(root_scroll); |
| 542 | DCHECK(root_clip); |
| 543 | DCHECK(IsActiveTree()); |
| 544 | |
| 545 | gfx::Vector2dF scrollable_viewport_size = |
| 546 | gfx::RectF(ScrollableViewportSize()).bottom_right() - gfx::PointF(); |
| 547 | |
| 548 | gfx::Vector2dF original_viewport_size = |
| 549 | gfx::RectF(root_clip->bounds()).bottom_right() - |
| 550 | gfx::PointF(); |
| 551 | original_viewport_size.Scale(1 / page_scale_factor()); |
| 552 | |
| 553 | root_scroll->SetFixedContainerSizeDelta( |
| 554 | scrollable_viewport_size - original_viewport_size); |
| 555 | } |
| 556 | |
[email protected] | e4c3c87a | 2013-04-22 02:28:40 | [diff] [blame] | 557 | void LayerTreeImpl::SetLatencyInfo(const LatencyInfo& latency_info) { |
| 558 | latency_info_.MergeWith(latency_info); |
| 559 | } |
| 560 | |
| 561 | const LatencyInfo& LayerTreeImpl::GetLatencyInfo() { |
| 562 | return latency_info_; |
| 563 | } |
| 564 | |
| 565 | void LayerTreeImpl::ClearLatencyInfo() { |
| 566 | latency_info_.Clear(); |
| 567 | } |
| 568 | |
[email protected] | fcb846d | 2013-05-22 01:42:36 | [diff] [blame] | 569 | void LayerTreeImpl::WillModifyTilePriorities() { |
| 570 | layer_tree_host_impl_->tile_manager()->WillModifyTilePriorities(); |
| 571 | } |
| 572 | |
[email protected] | ca2902e9 | 2013-03-28 01:45:35 | [diff] [blame] | 573 | } // namespace cc |