OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 const LayerSelectionBound& end); | 285 const LayerSelectionBound& end); |
286 | 286 |
287 // Compute the current selection handle location and visbility with respect to | 287 // Compute the current selection handle location and visbility with respect to |
288 // the viewport. | 288 // the viewport. |
289 void GetViewportSelection(ViewportSelectionBound* start, | 289 void GetViewportSelection(ViewportSelectionBound* start, |
290 ViewportSelectionBound* end); | 290 ViewportSelectionBound* end); |
291 | 291 |
292 void RegisterPictureLayerImpl(PictureLayerImpl* layer); | 292 void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
293 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); | 293 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
294 | 294 |
| 295 void set_top_controls_layout_height(float height) { |
| 296 top_controls_layout_height_ = height; |
| 297 } |
| 298 void set_top_controls_top_offset(float offset) { |
| 299 top_controls_top_offset_ = offset; |
| 300 } |
| 301 void set_top_controls_delta(float delta) { |
| 302 top_controls_delta_ = delta; |
| 303 } |
| 304 void set_sent_top_controls_delta(float sent_delta) { |
| 305 sent_top_controls_delta_ = sent_delta; |
| 306 } |
| 307 |
| 308 float top_controls_layout_height() const { |
| 309 return top_controls_layout_height_; |
| 310 } |
| 311 float top_controls_top_offset() const { |
| 312 return top_controls_top_offset_; |
| 313 } |
| 314 float top_controls_delta() const { |
| 315 return top_controls_delta_; |
| 316 } |
| 317 float sent_top_controls_delta() const { |
| 318 return sent_top_controls_delta_; |
| 319 } |
| 320 float total_top_controls_top_offset() const { |
| 321 return top_controls_top_offset_ + top_controls_delta_; |
| 322 } |
| 323 |
295 protected: | 324 protected: |
296 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 325 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
297 void ReleaseResourcesRecursive(LayerImpl* current); | 326 void ReleaseResourcesRecursive(LayerImpl* current); |
298 | 327 |
299 LayerTreeHostImpl* layer_tree_host_impl_; | 328 LayerTreeHostImpl* layer_tree_host_impl_; |
300 int source_frame_number_; | 329 int source_frame_number_; |
301 scoped_ptr<LayerImpl> root_layer_; | 330 scoped_ptr<LayerImpl> root_layer_; |
302 HeadsUpDisplayLayerImpl* hud_layer_; | 331 HeadsUpDisplayLayerImpl* hud_layer_; |
303 LayerImpl* currently_scrolling_layer_; | 332 LayerImpl* currently_scrolling_layer_; |
304 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 333 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 bool next_activation_forces_redraw_; | 374 bool next_activation_forces_redraw_; |
346 | 375 |
347 bool has_ever_been_drawn_; | 376 bool has_ever_been_drawn_; |
348 | 377 |
349 ScopedPtrVector<SwapPromise> swap_promise_list_; | 378 ScopedPtrVector<SwapPromise> swap_promise_list_; |
350 | 379 |
351 UIResourceRequestQueue ui_resource_request_queue_; | 380 UIResourceRequestQueue ui_resource_request_queue_; |
352 | 381 |
353 int render_surface_layer_list_id_; | 382 int render_surface_layer_list_id_; |
354 | 383 |
| 384 // The top controls content offset at the time of the last layout (and thus, |
| 385 // viewport resize) in Blink. i.e. How much the viewport was shrunk by the top |
| 386 // controls. |
| 387 float top_controls_layout_height_; |
| 388 |
| 389 // The up-to-date content offset of the top controls, i.e. the amount that the |
| 390 // web contents have been shifted down from the top of the device viewport. |
| 391 float top_controls_top_offset_; |
| 392 float top_controls_delta_; |
| 393 float sent_top_controls_delta_; |
| 394 |
355 private: | 395 private: |
356 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 396 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
357 }; | 397 }; |
358 | 398 |
359 } // namespace cc | 399 } // namespace cc |
360 | 400 |
361 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 401 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |