| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 }; | 27 }; |
| 28 } // namespace BASE_HASH_NAMESPACE | 28 } // namespace BASE_HASH_NAMESPACE |
| 29 #endif // COMPILER | 29 #endif // COMPILER |
| 30 | 30 |
| 31 namespace cc { | 31 namespace cc { |
| 32 | 32 |
| 33 class ContextProvider; | 33 class ContextProvider; |
| 34 class DebugRectHistory; | 34 class DebugRectHistory; |
| 35 class FrameRateCounter; | 35 class FrameRateCounter; |
| 36 class HeadsUpDisplayLayerImpl; | 36 class HeadsUpDisplayLayerImpl; |
| 37 class LayerScrollOffsetDelegateProxy; |
| 37 class LayerTreeDebugState; | 38 class LayerTreeDebugState; |
| 38 class LayerTreeHostImpl; | 39 class LayerTreeHostImpl; |
| 39 class LayerTreeImpl; | 40 class LayerTreeImpl; |
| 40 class LayerTreeSettings; | 41 class LayerTreeSettings; |
| 41 class MemoryHistory; | 42 class MemoryHistory; |
| 42 class OutputSurface; | 43 class OutputSurface; |
| 43 class PaintTimeCounter; | 44 class PaintTimeCounter; |
| 44 class Proxy; | 45 class Proxy; |
| 45 class ResourceProvider; | 46 class ResourceProvider; |
| 46 class TileManager; | 47 class TileManager; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 int source_frame_number() const { return source_frame_number_; } | 107 int source_frame_number() const { return source_frame_number_; } |
| 107 void set_source_frame_number(int frame_number) { | 108 void set_source_frame_number(int frame_number) { |
| 108 source_frame_number_ = frame_number; | 109 source_frame_number_ = frame_number; |
| 109 } | 110 } |
| 110 | 111 |
| 111 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } | 112 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } |
| 112 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { | 113 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { |
| 113 hud_layer_ = layer_impl; | 114 hud_layer_ = layer_impl; |
| 114 } | 115 } |
| 115 | 116 |
| 116 LayerImpl* RootScrollLayer() const; | 117 LayerImpl* InnerViewportScrollLayer() const; |
| 118 // This function may return NULL, it is the caller's responsibility to check. |
| 119 LayerImpl* OuterViewportScrollLayer() const; |
| 120 gfx::Vector2dF TotalScrollOffset() const; |
| 121 gfx::Vector2dF TotalMaxScrollOffset() const; |
| 122 gfx::Vector2dF TotalScrollDelta() const; |
| 123 |
| 117 LayerImpl* RootContainerLayer() const; | 124 LayerImpl* RootContainerLayer() const; |
| 118 LayerImpl* CurrentlyScrollingLayer() const; | 125 LayerImpl* CurrentlyScrollingLayer() const; |
| 119 void SetCurrentlyScrollingLayer(LayerImpl* layer); | 126 void SetCurrentlyScrollingLayer(LayerImpl* layer); |
| 120 void ClearCurrentlyScrollingLayer(); | 127 void ClearCurrentlyScrollingLayer(); |
| 128 float VerticalAdjust(const LayerImpl* layer) const; |
| 121 | 129 |
| 122 void FindRootScrollLayer(); | |
| 123 void UpdateMaxScrollOffset(); | |
| 124 void SetViewportLayersFromIds(int page_scale_layer_id, | 130 void SetViewportLayersFromIds(int page_scale_layer_id, |
| 125 int inner_viewport_scroll_layer_id, | 131 int inner_viewport_scroll_layer_id, |
| 126 int outer_viewport_scroll_layer_id); | 132 int outer_viewport_scroll_layer_id); |
| 127 void ClearViewportLayers(); | 133 void ClearViewportLayers(); |
| 134 LayerImpl* page_scale_layer() { return page_scale_layer_; } |
| 128 void ApplySentScrollAndScaleDeltasFromAbortedCommit(); | 135 void ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
| 129 void ApplyScrollDeltasSinceBeginMainFrame(); | 136 void ApplyScrollDeltasSinceBeginMainFrame(); |
| 130 | 137 |
| 131 SkColor background_color() const { return background_color_; } | 138 SkColor background_color() const { return background_color_; } |
| 132 void set_background_color(SkColor color) { background_color_ = color; } | 139 void set_background_color(SkColor color) { background_color_ = color; } |
| 133 | 140 |
| 134 bool has_transparent_background() const { | 141 bool has_transparent_background() const { |
| 135 return has_transparent_background_; | 142 return has_transparent_background_; |
| 136 } | 143 } |
| 137 void set_has_transparent_background(bool transparent) { | 144 void set_has_transparent_background(bool transparent) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // and the active tree's size is now out of date. | 207 // and the active tree's size is now out of date. |
| 201 bool ViewportSizeInvalid() const; | 208 bool ViewportSizeInvalid() const; |
| 202 void SetViewportSizeInvalid(); | 209 void SetViewportSizeInvalid(); |
| 203 void ResetViewportSizeInvalid(); | 210 void ResetViewportSizeInvalid(); |
| 204 | 211 |
| 205 // Useful for debug assertions, probably shouldn't be used for anything else. | 212 // Useful for debug assertions, probably shouldn't be used for anything else. |
| 206 Proxy* proxy() const; | 213 Proxy* proxy() const; |
| 207 | 214 |
| 208 void SetRootLayerScrollOffsetDelegate( | 215 void SetRootLayerScrollOffsetDelegate( |
| 209 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 216 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
| 217 void UpdateScrollOffsetDelegate(); |
| 218 gfx::Vector2dF GetDelegatedScrollOffset(LayerImpl* layer); |
| 210 | 219 |
| 211 // Call this function when you expect there to be a swap buffer. | 220 // Call this function when you expect there to be a swap buffer. |
| 212 // See swap_promise.h for how to use SwapPromise. | 221 // See swap_promise.h for how to use SwapPromise. |
| 213 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 222 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
| 214 | 223 |
| 215 // Take the |new_swap_promise| and append it to |swap_promise_list_|. | 224 // Take the |new_swap_promise| and append it to |swap_promise_list_|. |
| 216 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | 225 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); |
| 217 void FinishSwapPromises(CompositorFrameMetadata* metadata); | 226 void FinishSwapPromises(CompositorFrameMetadata* metadata); |
| 218 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 227 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
| 219 | 228 |
| 220 void DidModifyTilePriorities(); | 229 void DidModifyTilePriorities(); |
| 221 | 230 |
| 222 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 231 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
| 223 void ProcessUIResourceRequestQueue(); | 232 void ProcessUIResourceRequestQueue(); |
| 224 | 233 |
| 225 bool IsUIResourceOpaque(UIResourceId uid) const; | 234 bool IsUIResourceOpaque(UIResourceId uid) const; |
| 226 | 235 |
| 227 void AddLayerWithCopyOutputRequest(LayerImpl* layer); | 236 void AddLayerWithCopyOutputRequest(LayerImpl* layer); |
| 228 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); | 237 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); |
| 229 const std::vector<LayerImpl*>& LayersWithCopyOutputRequest() const; | 238 const std::vector<LayerImpl*>& LayersWithCopyOutputRequest() const; |
| 230 | 239 |
| 231 protected: | 240 protected: |
| 232 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 241 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
| 233 | 242 |
| 234 void UpdateSolidColorScrollbars(); | |
| 235 | |
| 236 void UpdateRootScrollLayerSizeDelta(); | 243 void UpdateRootScrollLayerSizeDelta(); |
| 237 | 244 |
| 238 LayerTreeHostImpl* layer_tree_host_impl_; | 245 LayerTreeHostImpl* layer_tree_host_impl_; |
| 239 int source_frame_number_; | 246 int source_frame_number_; |
| 240 scoped_ptr<LayerImpl> root_layer_; | 247 scoped_ptr<LayerImpl> root_layer_; |
| 241 HeadsUpDisplayLayerImpl* hud_layer_; | 248 HeadsUpDisplayLayerImpl* hud_layer_; |
| 242 LayerImpl* root_scroll_layer_; | |
| 243 LayerImpl* currently_scrolling_layer_; | 249 LayerImpl* currently_scrolling_layer_; |
| 244 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 250 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
| 251 scoped_ptr<LayerScrollOffsetDelegateProxy> |
| 252 inner_viewport_scroll_delegate_proxy_; |
| 253 scoped_ptr<LayerScrollOffsetDelegateProxy> |
| 254 outer_viewport_scroll_delegate_proxy_; |
| 245 SkColor background_color_; | 255 SkColor background_color_; |
| 246 bool has_transparent_background_; | 256 bool has_transparent_background_; |
| 247 | 257 |
| 248 LayerImpl* page_scale_layer_; | 258 LayerImpl* page_scale_layer_; |
| 249 LayerImpl* inner_viewport_scroll_layer_; | 259 LayerImpl* inner_viewport_scroll_layer_; |
| 250 LayerImpl* outer_viewport_scroll_layer_; | 260 LayerImpl* outer_viewport_scroll_layer_; |
| 251 | 261 |
| 252 float page_scale_factor_; | 262 float page_scale_factor_; |
| 253 float page_scale_delta_; | 263 float page_scale_delta_; |
| 254 float sent_page_scale_delta_; | 264 float sent_page_scale_delta_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 281 | 291 |
| 282 UIResourceRequestQueue ui_resource_request_queue_; | 292 UIResourceRequestQueue ui_resource_request_queue_; |
| 283 | 293 |
| 284 private: | 294 private: |
| 285 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 295 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 286 }; | 296 }; |
| 287 | 297 |
| 288 } // namespace cc | 298 } // namespace cc |
| 289 | 299 |
| 290 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 300 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |