| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 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 | 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_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 static scoped_ptr<LayerTreeHostImpl> Create( | 118 static scoped_ptr<LayerTreeHostImpl> Create( |
| 119 const LayerTreeSettings& settings, | 119 const LayerTreeSettings& settings, |
| 120 LayerTreeHostImplClient* client, | 120 LayerTreeHostImplClient* client, |
| 121 Proxy* proxy, | 121 Proxy* proxy, |
| 122 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 122 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 123 SharedBitmapManager* manager, | 123 SharedBitmapManager* manager, |
| 124 int id); | 124 int id); |
| 125 virtual ~LayerTreeHostImpl(); | 125 virtual ~LayerTreeHostImpl(); |
| 126 | 126 |
| 127 // BeginFrameSourceMixIn implementation | 127 // BeginFrameSourceMixIn implementation |
| 128 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) OVERRIDE; | 128 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
| 129 | 129 |
| 130 // InputHandler implementation | 130 // InputHandler implementation |
| 131 virtual void BindToClient(InputHandlerClient* client) OVERRIDE; | 131 virtual void BindToClient(InputHandlerClient* client) override; |
| 132 virtual InputHandler::ScrollStatus ScrollBegin( | 132 virtual InputHandler::ScrollStatus ScrollBegin( |
| 133 const gfx::Point& viewport_point, | 133 const gfx::Point& viewport_point, |
| 134 InputHandler::ScrollInputType type) OVERRIDE; | 134 InputHandler::ScrollInputType type) override; |
| 135 virtual InputHandler::ScrollStatus ScrollAnimated( | 135 virtual InputHandler::ScrollStatus ScrollAnimated( |
| 136 const gfx::Point& viewport_point, | 136 const gfx::Point& viewport_point, |
| 137 const gfx::Vector2dF& scroll_delta) OVERRIDE; | 137 const gfx::Vector2dF& scroll_delta) override; |
| 138 virtual bool ScrollBy(const gfx::Point& viewport_point, | 138 virtual bool ScrollBy(const gfx::Point& viewport_point, |
| 139 const gfx::Vector2dF& scroll_delta) OVERRIDE; | 139 const gfx::Vector2dF& scroll_delta) override; |
| 140 virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point, | 140 virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point, |
| 141 ScrollDirection direction) OVERRIDE; | 141 ScrollDirection direction) override; |
| 142 virtual void SetRootLayerScrollOffsetDelegate( | 142 virtual void SetRootLayerScrollOffsetDelegate( |
| 143 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE; | 143 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; |
| 144 virtual void OnRootLayerDelegatedScrollOffsetChanged() OVERRIDE; | 144 virtual void OnRootLayerDelegatedScrollOffsetChanged() override; |
| 145 virtual void ScrollEnd() OVERRIDE; | 145 virtual void ScrollEnd() override; |
| 146 virtual InputHandler::ScrollStatus FlingScrollBegin() OVERRIDE; | 146 virtual InputHandler::ScrollStatus FlingScrollBegin() override; |
| 147 virtual void MouseMoveAt(const gfx::Point& viewport_point) OVERRIDE; | 147 virtual void MouseMoveAt(const gfx::Point& viewport_point) override; |
| 148 virtual void PinchGestureBegin() OVERRIDE; | 148 virtual void PinchGestureBegin() override; |
| 149 virtual void PinchGestureUpdate(float magnify_delta, | 149 virtual void PinchGestureUpdate(float magnify_delta, |
| 150 const gfx::Point& anchor) OVERRIDE; | 150 const gfx::Point& anchor) override; |
| 151 virtual void PinchGestureEnd() OVERRIDE; | 151 virtual void PinchGestureEnd() override; |
| 152 virtual void SetNeedsAnimate() OVERRIDE; | 152 virtual void SetNeedsAnimate() override; |
| 153 virtual bool IsCurrentlyScrollingLayerAt( | 153 virtual bool IsCurrentlyScrollingLayerAt( |
| 154 const gfx::Point& viewport_point, | 154 const gfx::Point& viewport_point, |
| 155 InputHandler::ScrollInputType type) OVERRIDE; | 155 InputHandler::ScrollInputType type) override; |
| 156 virtual bool HaveTouchEventHandlersAt( | 156 virtual bool HaveTouchEventHandlersAt( |
| 157 const gfx::Point& viewport_port) OVERRIDE; | 157 const gfx::Point& viewport_port) override; |
| 158 virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( | 158 virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
| 159 ui::LatencyInfo* latency) OVERRIDE; | 159 ui::LatencyInfo* latency) override; |
| 160 | 160 |
| 161 // TopControlsManagerClient implementation. | 161 // TopControlsManagerClient implementation. |
| 162 virtual void SetControlsTopOffset(float offset) OVERRIDE; | 162 virtual void SetControlsTopOffset(float offset) override; |
| 163 virtual float ControlsTopOffset() const OVERRIDE; | 163 virtual float ControlsTopOffset() const override; |
| 164 virtual void DidChangeTopControlsPosition() OVERRIDE; | 164 virtual void DidChangeTopControlsPosition() override; |
| 165 virtual bool HaveRootScrollLayer() const OVERRIDE; | 165 virtual bool HaveRootScrollLayer() const override; |
| 166 | 166 |
| 167 struct CC_EXPORT FrameData : public RenderPassSink { | 167 struct CC_EXPORT FrameData : public RenderPassSink { |
| 168 FrameData(); | 168 FrameData(); |
| 169 virtual ~FrameData(); | 169 virtual ~FrameData(); |
| 170 void AsValueInto(base::debug::TracedValue* value) const; | 170 void AsValueInto(base::debug::TracedValue* value) const; |
| 171 | 171 |
| 172 std::vector<gfx::Rect> occluding_screen_space_rects; | 172 std::vector<gfx::Rect> occluding_screen_space_rects; |
| 173 std::vector<gfx::Rect> non_occluding_screen_space_rects; | 173 std::vector<gfx::Rect> non_occluding_screen_space_rects; |
| 174 RenderPassList render_passes; | 174 RenderPassList render_passes; |
| 175 RenderPassIdHashMap render_passes_by_id; | 175 RenderPassIdHashMap render_passes_by_id; |
| 176 const LayerImplList* render_surface_layer_list; | 176 const LayerImplList* render_surface_layer_list; |
| 177 LayerImplList will_draw_layers; | 177 LayerImplList will_draw_layers; |
| 178 bool contains_incomplete_tile; | 178 bool contains_incomplete_tile; |
| 179 bool has_no_damage; | 179 bool has_no_damage; |
| 180 | 180 |
| 181 // RenderPassSink implementation. | 181 // RenderPassSink implementation. |
| 182 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; | 182 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 virtual void BeginMainFrameAborted(bool did_handle); | 185 virtual void BeginMainFrameAborted(bool did_handle); |
| 186 virtual void BeginCommit(); | 186 virtual void BeginCommit(); |
| 187 virtual void CommitComplete(); | 187 virtual void CommitComplete(); |
| 188 virtual void Animate(base::TimeTicks monotonic_time); | 188 virtual void Animate(base::TimeTicks monotonic_time); |
| 189 virtual void UpdateAnimationState(bool start_ready_animations); | 189 virtual void UpdateAnimationState(bool start_ready_animations); |
| 190 void ActivateAnimations(); | 190 void ActivateAnimations(); |
| 191 void MainThreadHasStoppedFlinging(); | 191 void MainThreadHasStoppedFlinging(); |
| 192 void UpdateBackgroundAnimateTicking(bool should_background_tick); | 192 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 DrawMode GetDrawMode() const; | 224 DrawMode GetDrawMode() const; |
| 225 | 225 |
| 226 // Viewport size in draw space: this size is in physical pixels and is used | 226 // Viewport size in draw space: this size is in physical pixels and is used |
| 227 // for draw properties, tilings, quads and render passes. | 227 // for draw properties, tilings, quads and render passes. |
| 228 gfx::Size DrawViewportSize() const; | 228 gfx::Size DrawViewportSize() const; |
| 229 | 229 |
| 230 // Viewport rect in view space used for tiling prioritization. | 230 // Viewport rect in view space used for tiling prioritization. |
| 231 const gfx::Rect ViewportRectForTilePriority() const; | 231 const gfx::Rect ViewportRectForTilePriority() const; |
| 232 | 232 |
| 233 // RendererClient implementation. | 233 // RendererClient implementation. |
| 234 virtual void SetFullRootLayerDamage() OVERRIDE; | 234 virtual void SetFullRootLayerDamage() override; |
| 235 | 235 |
| 236 // TileManagerClient implementation. | 236 // TileManagerClient implementation. |
| 237 virtual const std::vector<PictureLayerImpl*>& GetPictureLayers() | 237 virtual const std::vector<PictureLayerImpl*>& GetPictureLayers() |
| 238 const OVERRIDE; | 238 const override; |
| 239 virtual void NotifyReadyToActivate() OVERRIDE; | 239 virtual void NotifyReadyToActivate() override; |
| 240 virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE; | 240 virtual void NotifyTileStateChanged(const Tile* tile) override; |
| 241 virtual void BuildRasterQueue(RasterTilePriorityQueue* queue, | 241 virtual void BuildRasterQueue(RasterTilePriorityQueue* queue, |
| 242 TreePriority tree_priority) OVERRIDE; | 242 TreePriority tree_priority) override; |
| 243 virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue, | 243 virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue, |
| 244 TreePriority tree_priority) OVERRIDE; | 244 TreePriority tree_priority) override; |
| 245 | 245 |
| 246 // ScrollbarAnimationControllerClient implementation. | 246 // ScrollbarAnimationControllerClient implementation. |
| 247 virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, | 247 virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, |
| 248 base::TimeDelta delay) OVERRIDE; | 248 base::TimeDelta delay) override; |
| 249 virtual void SetNeedsScrollbarAnimationFrame() OVERRIDE; | 249 virtual void SetNeedsScrollbarAnimationFrame() override; |
| 250 | 250 |
| 251 // OutputSurfaceClient implementation. | 251 // OutputSurfaceClient implementation. |
| 252 virtual void DeferredInitialize() OVERRIDE; | 252 virtual void DeferredInitialize() override; |
| 253 virtual void ReleaseGL() OVERRIDE; | 253 virtual void ReleaseGL() override; |
| 254 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 254 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
| 255 base::TimeDelta interval) OVERRIDE; | 255 base::TimeDelta interval) override; |
| 256 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) OVERRIDE; | 256 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
| 257 virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE; | 257 virtual void BeginFrame(const BeginFrameArgs& args) override; |
| 258 | 258 |
| 259 virtual void SetExternalDrawConstraints( | 259 virtual void SetExternalDrawConstraints( |
| 260 const gfx::Transform& transform, | 260 const gfx::Transform& transform, |
| 261 const gfx::Rect& viewport, | 261 const gfx::Rect& viewport, |
| 262 const gfx::Rect& clip, | 262 const gfx::Rect& clip, |
| 263 const gfx::Rect& viewport_rect_for_tile_priority, | 263 const gfx::Rect& viewport_rect_for_tile_priority, |
| 264 const gfx::Transform& transform_for_tile_priority, | 264 const gfx::Transform& transform_for_tile_priority, |
| 265 bool resourceless_software_draw) OVERRIDE; | 265 bool resourceless_software_draw) override; |
| 266 virtual void DidLoseOutputSurface() OVERRIDE; | 266 virtual void DidLoseOutputSurface() override; |
| 267 virtual void DidSwapBuffers() OVERRIDE; | 267 virtual void DidSwapBuffers() override; |
| 268 virtual void DidSwapBuffersComplete() OVERRIDE; | 268 virtual void DidSwapBuffersComplete() override; |
| 269 virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE; | 269 virtual void ReclaimResources(const CompositorFrameAck* ack) override; |
| 270 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE; | 270 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 271 virtual void SetTreeActivationCallback(const base::Closure& callback) | 271 virtual void SetTreeActivationCallback(const base::Closure& callback) |
| 272 OVERRIDE; | 272 override; |
| 273 | 273 |
| 274 // Called from LayerTreeImpl. | 274 // Called from LayerTreeImpl. |
| 275 void OnCanDrawStateChangedForTree(); | 275 void OnCanDrawStateChangedForTree(); |
| 276 | 276 |
| 277 // Implementation. | 277 // Implementation. |
| 278 int id() const { return id_; } | 278 int id() const { return id_; } |
| 279 bool CanDraw() const; | 279 bool CanDraw() const; |
| 280 OutputSurface* output_surface() const { return output_surface_.get(); } | 280 OutputSurface* output_surface() const { return output_surface_.get(); } |
| 281 | 281 |
| 282 std::string LayerTreeAsJson() const; | 282 std::string LayerTreeAsJson() const; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 | 420 |
| 421 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 421 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
| 422 void ResetCurrentBeginFrameArgsForNextFrame(); | 422 void ResetCurrentBeginFrameArgsForNextFrame(); |
| 423 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 423 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
| 424 | 424 |
| 425 // Expected time between two begin impl frame calls. | 425 // Expected time between two begin impl frame calls. |
| 426 base::TimeDelta begin_impl_frame_interval() const { | 426 base::TimeDelta begin_impl_frame_interval() const { |
| 427 return begin_impl_frame_interval_; | 427 return begin_impl_frame_interval_; |
| 428 } | 428 } |
| 429 | 429 |
| 430 virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE; | 430 virtual void AsValueInto(base::debug::TracedValue* value) const override; |
| 431 void AsValueWithFrameInto(FrameData* frame, | 431 void AsValueWithFrameInto(FrameData* frame, |
| 432 base::debug::TracedValue* value) const; | 432 base::debug::TracedValue* value) const; |
| 433 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 433 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 434 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 434 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
| 435 FrameData* frame) const; | 435 FrameData* frame) const; |
| 436 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 436 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
| 437 const; | 437 const; |
| 438 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 438 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
| 439 | 439 |
| 440 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 440 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 702 |
| 703 std::vector<PictureLayerImpl*> picture_layers_; | 703 std::vector<PictureLayerImpl*> picture_layers_; |
| 704 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 704 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
| 705 | 705 |
| 706 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 706 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 707 }; | 707 }; |
| 708 | 708 |
| 709 } // namespace cc | 709 } // namespace cc |
| 710 | 710 |
| 711 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 711 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |