[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 1 | // Copyright 2011 The Chromium Authors. All rights reserved. |
[email protected] | 0fb2500 | 2012-10-12 07:20:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 4 | |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 5 | #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 6 | #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 7 | |
[email protected] | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
[email protected] | c4040a52 | 2012-10-21 15:01:40 | [diff] [blame] | 11 | #include "base/basictypes.h" |
| 12 | #include "base/memory/scoped_ptr.h" |
| 13 | #include "base/time.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 14 | #include "cc/animation/animation_events.h" |
| 15 | #include "cc/animation/animation_registrar.h" |
[email protected] | 681ccff | 2013-03-18 06:13:52 | [diff] [blame] | 16 | #include "cc/base/cc_export.h" |
[email protected] | e4c3c87a | 2013-04-22 02:28:40 | [diff] [blame] | 17 | #include "cc/debug/latency_info.h" |
[email protected] | 3052b10f | 2013-03-18 07:41:21 | [diff] [blame] | 18 | #include "cc/input/input_handler.h" |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 19 | #include "cc/input/layer_scroll_offset_delegate.h" |
[email protected] | 3052b10f | 2013-03-18 07:41:21 | [diff] [blame] | 20 | #include "cc/input/top_controls_manager_client.h" |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 21 | #include "cc/layers/layer_lists.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 22 | #include "cc/layers/render_pass_sink.h" |
[email protected] | 7f0d825f | 2013-03-18 07:24:30 | [diff] [blame] | 23 | #include "cc/output/output_surface_client.h" |
| 24 | #include "cc/output/renderer.h" |
[email protected] | 89e8267a | 2013-03-18 07:50:56 | [diff] [blame] | 25 | #include "cc/quads/render_pass.h" |
[email protected] | e12dd0e | 2013-03-18 08:24:40 | [diff] [blame] | 26 | #include "cc/resources/tile_manager.h" |
[email protected] | b9dcf43a | 2013-01-09 00:15:29 | [diff] [blame] | 27 | #include "skia/ext/refptr.h" |
[email protected] | ddf9df8 | 2012-10-16 06:52:46 | [diff] [blame] | 28 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | b9dcf43a | 2013-01-09 00:15:29 | [diff] [blame] | 29 | #include "third_party/skia/include/core/SkPicture.h" |
[email protected] | 167ed9d5 | 2012-10-31 20:47:58 | [diff] [blame] | 30 | #include "ui/gfx/rect.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 31 | |
| 32 | namespace cc { |
| 33 | |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 34 | class CompletionEvent; |
[email protected] | bf189f6 | 2012-12-18 03:42:11 | [diff] [blame] | 35 | class CompositorFrameMetadata; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 36 | class DebugRectHistory; |
| 37 | class FrameRateCounter; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 38 | class LayerImpl; |
| 39 | class LayerTreeHostImplTimeSourceAdapter; |
[email protected] | 8bef4057 | 2012-12-11 21:38:08 | [diff] [blame] | 40 | class LayerTreeImpl; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 41 | class PageScaleAnimation; |
[email protected] | 0edbfbe9f | 2013-01-17 03:33:03 | [diff] [blame] | 42 | class PaintTimeCounter; |
[email protected] | 1191d9d | 2013-02-02 06:00:33 | [diff] [blame] | 43 | class MemoryHistory; |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 44 | class RenderingStatsInstrumentation; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 45 | class RenderPassDrawQuad; |
| 46 | class ResourceProvider; |
[email protected] | 3ba4cae | 2013-01-16 03:58:38 | [diff] [blame] | 47 | class TopControlsManager; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 48 | struct RendererCapabilities; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 49 | |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 50 | // LayerTreeHost->Proxy callback interface. |
| 51 | class LayerTreeHostImplClient { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 52 | public: |
| 53 | virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
| 54 | virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
| 55 | virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
| 56 | base::TimeDelta interval) = 0; |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame^] | 57 | virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 58 | virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
| 59 | virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; |
| 60 | virtual void SetNeedsRedrawOnImplThread() = 0; |
[email protected] | 1cd9f555 | 2013-04-26 04:22:03 | [diff] [blame] | 61 | virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; |
[email protected] | 8612679 | 2013-03-16 20:07:54 | [diff] [blame] | 62 | virtual void DidInitializeVisibleTileOnImplThread() = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 63 | virtual void SetNeedsCommitOnImplThread() = 0; |
| 64 | virtual void SetNeedsManageTilesOnImplThread() = 0; |
| 65 | virtual void PostAnimationEventsToMainThreadOnImplThread( |
| 66 | scoped_ptr<AnimationEventsVector> events, |
| 67 | base::Time wall_clock_time) = 0; |
| 68 | // Returns true if resources were deleted by this call. |
| 69 | virtual bool ReduceContentsTextureMemoryOnImplThread( |
| 70 | size_t limit_bytes, |
| 71 | int priority_cutoff) = 0; |
| 72 | virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; |
| 73 | virtual void SendManagedMemoryStats() = 0; |
| 74 | virtual bool IsInsideDraw() = 0; |
| 75 | virtual void RenewTreePriority() = 0; |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 76 | virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0; |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame^] | 77 | virtual void DidReceiveLastInputEventForBeginFrameOnImplThread( |
| 78 | base::TimeTicks frame_time) = 0; |
[email protected] | 2a61ad5 | 2013-05-13 14:01:29 | [diff] [blame] | 79 | virtual void DidActivatePendingTree() = 0; |
[email protected] | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 80 | |
| 81 | protected: |
| 82 | virtual ~LayerTreeHostImplClient() {} |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 83 | }; |
| 84 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 85 | // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 86 | // state. |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 87 | class CC_EXPORT LayerTreeHostImpl |
| 88 | : public InputHandler, |
| 89 | public RendererClient, |
| 90 | public TileManagerClient, |
| 91 | public OutputSurfaceClient, |
| 92 | public TopControlsManagerClient, |
| 93 | public base::SupportsWeakPtr<LayerTreeHostImpl> { |
[email protected] | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 94 | public: |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 95 | static scoped_ptr<LayerTreeHostImpl> Create( |
| 96 | const LayerTreeSettings& settings, |
| 97 | LayerTreeHostImplClient* client, |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 98 | Proxy* proxy, |
| 99 | RenderingStatsInstrumentation* rendering_stats_instrumentation); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 100 | virtual ~LayerTreeHostImpl(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 101 | |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 102 | // InputHandler implementation |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 103 | virtual void BindToClient(InputHandlerClient* client) OVERRIDE; |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 104 | virtual InputHandler::ScrollStatus ScrollBegin( |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 105 | gfx::Point viewport_point, |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 106 | InputHandler::ScrollInputType type) OVERRIDE; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 107 | virtual bool ScrollBy(gfx::Point viewport_point, |
| 108 | gfx::Vector2dF scroll_delta) OVERRIDE; |
[email protected] | c28df4c1 | 2013-05-22 17:36:49 | [diff] [blame] | 109 | virtual bool ScrollVerticallyByPage(gfx::Point viewport_point, |
| 110 | ScrollDirection direction) OVERRIDE; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 111 | virtual void SetRootLayerScrollOffsetDelegate( |
| 112 | LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE; |
| 113 | virtual void OnRootLayerDelegatedScrollOffsetChanged() OVERRIDE; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 114 | virtual void ScrollEnd() OVERRIDE; |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 115 | virtual InputHandler::ScrollStatus FlingScrollBegin() OVERRIDE; |
[email protected] | 6e921bd | 2013-04-29 21:10:20 | [diff] [blame] | 116 | virtual void NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) OVERRIDE; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 117 | virtual void PinchGestureBegin() OVERRIDE; |
| 118 | virtual void PinchGestureUpdate(float magnify_delta, |
| 119 | gfx::Point anchor) OVERRIDE; |
| 120 | virtual void PinchGestureEnd() OVERRIDE; |
| 121 | virtual void StartPageScaleAnimation(gfx::Vector2d target_offset, |
| 122 | bool anchor_point, |
| 123 | float page_scale, |
| 124 | base::TimeTicks start_time, |
| 125 | base::TimeDelta duration) OVERRIDE; |
| 126 | virtual void ScheduleAnimation() OVERRIDE; |
| 127 | virtual bool HaveTouchEventHandlersAt(gfx::Point viewport_port) OVERRIDE; |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame^] | 128 | virtual void DidReceiveLastInputEventForBeginFrame( |
[email protected] | ef915f53 | 2013-04-22 20:56:32 | [diff] [blame] | 129 | base::TimeTicks frame_time) OVERRIDE; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 130 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 131 | // TopControlsManagerClient implementation. |
[email protected] | 59adb11 | 2013-04-09 04:48:44 | [diff] [blame] | 132 | virtual void DidChangeTopControlsPosition() OVERRIDE; |
| 133 | virtual bool HaveRootScrollLayer() const OVERRIDE; |
[email protected] | 3ba4cae | 2013-01-16 03:58:38 | [diff] [blame] | 134 | |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 135 | void StartScrollbarAnimation(base::TimeTicks now); |
| 136 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 137 | struct CC_EXPORT FrameData : public RenderPassSink { |
| 138 | FrameData(); |
[email protected] | ca2902e9 | 2013-03-28 01:45:35 | [diff] [blame] | 139 | virtual ~FrameData(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 140 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 141 | std::vector<gfx::Rect> occluding_screen_space_rects; |
| 142 | std::vector<gfx::Rect> non_occluding_screen_space_rects; |
| 143 | RenderPassList render_passes; |
| 144 | RenderPassIdHashMap render_passes_by_id; |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 145 | const LayerImplList* render_surface_layer_list; |
| 146 | LayerImplList will_draw_layers; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 147 | bool contains_incomplete_tile; |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 148 | bool has_no_damage; |
[email protected] | e4c3c87a | 2013-04-22 02:28:40 | [diff] [blame] | 149 | LatencyInfo latency_info; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 150 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 151 | // RenderPassSink implementation. |
| 152 | virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; |
| 153 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 154 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 155 | virtual void BeginCommit(); |
| 156 | virtual void CommitComplete(); |
| 157 | virtual void Animate(base::TimeTicks monotonic_time, |
| 158 | base::Time wall_clock_time); |
[email protected] | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 159 | virtual void UpdateAnimationState(bool start_ready_animations); |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 160 | void MainThreadHasStoppedFlinging(); |
[email protected] | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 161 | void UpdateBackgroundAnimateTicking(bool should_background_tick); |
[email protected] | b9d4a36 | 2013-04-23 05:36:27 | [diff] [blame] | 162 | void SetViewportDamage(gfx::Rect damage_rect); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 163 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 164 | void ManageTiles(); |
[email protected] | 8947cbe | 2012-11-28 05:27:43 | [diff] [blame] | 165 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 166 | // Returns false if problems occured preparing the frame, and we should try |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 167 | // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 168 | // must also be called, regardless of whether DrawLayers is called between the |
| 169 | // two. |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 170 | virtual bool PrepareToDraw(FrameData* frame, |
| 171 | gfx::Rect device_viewport_damage_rect); |
[email protected] | f0c2a24 | 2013-03-15 19:34:52 | [diff] [blame] | 172 | virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 173 | // Must be called if and only if PrepareToDraw was called. |
| 174 | void DidDrawAllLayers(const FrameData& frame); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 175 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 176 | const LayerTreeSettings& settings() const { return settings_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 177 | |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 178 | // Returns the currently visible viewport size in DIP. This value excludes |
| 179 | // the URL bar and non-overlay scrollbars. |
| 180 | gfx::SizeF VisibleViewportSize() const; |
| 181 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 182 | // RendererClient implementation |
| 183 | private: |
| 184 | virtual gfx::Size DeviceViewportSize() const OVERRIDE; |
| 185 | virtual const LayerTreeSettings& Settings() const OVERRIDE; |
| 186 | public: |
| 187 | virtual void DidLoseOutputSurface() OVERRIDE; |
| 188 | virtual void OnSwapBuffersComplete() OVERRIDE; |
| 189 | virtual void SetFullRootLayerDamage() OVERRIDE; |
| 190 | virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
| 191 | OVERRIDE; |
| 192 | virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
| 193 | OVERRIDE; |
| 194 | virtual bool HasImplThread() const OVERRIDE; |
| 195 | virtual bool ShouldClearRootRenderPass() const OVERRIDE; |
| 196 | virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; |
[email protected] | 7367359 | 2013-04-03 22:14:32 | [diff] [blame] | 197 | virtual bool AllowPartialSwap() const OVERRIDE; |
[email protected] | 8947cbe | 2012-11-28 05:27:43 | [diff] [blame] | 198 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 199 | // TileManagerClient implementation. |
| 200 | virtual void ScheduleManageTiles() OVERRIDE; |
[email protected] | 8612679 | 2013-03-16 20:07:54 | [diff] [blame] | 201 | virtual void DidInitializeVisibleTile() OVERRIDE; |
[email protected] | fcb846d | 2013-05-22 01:42:36 | [diff] [blame] | 202 | virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const |
| 203 | OVERRIDE; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 204 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 205 | // OutputSurfaceClient implementation. |
[email protected] | 1cd9f555 | 2013-04-26 04:22:03 | [diff] [blame] | 206 | virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 207 | virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
| 208 | base::TimeDelta interval) OVERRIDE; |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame^] | 209 | virtual void BeginFrame(base::TimeTicks frame_time) |
| 210 | OVERRIDE; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 211 | virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) |
| 212 | OVERRIDE; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 213 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 214 | // Called from LayerTreeImpl. |
| 215 | void OnCanDrawStateChangedForTree(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 216 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 217 | // Implementation |
| 218 | bool CanDraw(); |
| 219 | OutputSurface* output_surface() const { return output_surface_.get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 220 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 221 | std::string LayerTreeAsText() const; |
| 222 | std::string LayerTreeAsJson() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 223 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 224 | void FinishAllRendering(); |
| 225 | int SourceAnimationFrameNumber() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 226 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 227 | virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
| 228 | bool IsContextLost(); |
| 229 | TileManager* tile_manager() { return tile_manager_.get(); } |
| 230 | Renderer* renderer() { return renderer_.get(); } |
| 231 | const RendererCapabilities& GetRendererCapabilities() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 232 | |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 233 | virtual bool SwapBuffers(const FrameData& frame); |
[email protected] | c8cbae7 | 2013-05-23 10:45:03 | [diff] [blame^] | 234 | void SetNeedsBeginFrame(bool enable); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 235 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 236 | void Readback(void* pixels, gfx::Rect rect_in_device_viewport); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 237 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 238 | LayerTreeImpl* active_tree() { return active_tree_.get(); } |
| 239 | const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
| 240 | LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
| 241 | const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
| 242 | const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
| 243 | void CreatePendingTree(); |
| 244 | void CheckForCompletedTileUploads(); |
| 245 | virtual bool ActivatePendingTreeIfNeeded(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 246 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 247 | // Shortcuts to layers on the active tree. |
| 248 | LayerImpl* RootLayer() const; |
| 249 | LayerImpl* RootScrollLayer() const; |
| 250 | LayerImpl* CurrentlyScrollingLayer() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 251 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 252 | virtual void SetVisible(bool visible); |
| 253 | bool visible() const { return visible_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 254 | |
[email protected] | d7eb8c7 | 2013-03-23 22:57:13 | [diff] [blame] | 255 | void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } |
[email protected] | 59adb11 | 2013-04-09 04:48:44 | [diff] [blame] | 256 | void SetNeedsRedraw() { client_->SetNeedsRedrawOnImplThread(); } |
[email protected] | d7eb8c7 | 2013-03-23 22:57:13 | [diff] [blame] | 257 | |
[email protected] | 206a392 | 2013-05-17 06:34:12 | [diff] [blame] | 258 | ManagedMemoryPolicy ActualManagedMemoryPolicy() const; |
| 259 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 260 | size_t memory_allocation_limit_bytes() const { |
[email protected] | 46b8acc | 2013-03-19 22:38:35 | [diff] [blame] | 261 | return managed_memory_policy_.bytes_limit_when_visible; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 262 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 263 | |
[email protected] | 18ce5970 | 2013-04-09 04:58:40 | [diff] [blame] | 264 | void SetViewportSize(gfx::Size device_viewport_size); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 265 | gfx::Size device_viewport_size() const { return device_viewport_size_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 266 | |
[email protected] | d908376 | 2013-03-24 01:36:40 | [diff] [blame] | 267 | void SetOverdrawBottomHeight(float overdraw_bottom_height); |
| 268 | float overdraw_bottom_height() const { return overdraw_bottom_height_; } |
| 269 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 270 | void SetDeviceScaleFactor(float device_scale_factor); |
| 271 | float device_scale_factor() const { return device_scale_factor_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 272 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 273 | scoped_ptr<ScrollAndScaleSet> ProcessScrollDeltas(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 274 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 275 | bool needs_animate_layers() const { |
| 276 | return !animation_registrar_->active_animation_controllers().empty(); |
| 277 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 278 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 279 | void SendManagedMemoryStats( |
| 280 | size_t memory_visible_bytes, |
| 281 | size_t memory_visible_and_nearby_bytes, |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 282 | size_t memory_use_bytes); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 283 | |
[email protected] | d7626ffd | 2013-03-29 00:17:42 | [diff] [blame] | 284 | void set_max_memory_needed_bytes(size_t bytes) { |
| 285 | max_memory_needed_bytes_ = bytes; |
| 286 | } |
| 287 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 288 | FrameRateCounter* fps_counter() { |
| 289 | return fps_counter_.get(); |
| 290 | } |
| 291 | PaintTimeCounter* paint_time_counter() { |
| 292 | return paint_time_counter_.get(); |
| 293 | } |
| 294 | MemoryHistory* memory_history() { |
| 295 | return memory_history_.get(); |
| 296 | } |
| 297 | DebugRectHistory* debug_rect_history() { |
| 298 | return debug_rect_history_.get(); |
| 299 | } |
| 300 | ResourceProvider* resource_provider() { |
| 301 | return resource_provider_.get(); |
| 302 | } |
| 303 | TopControlsManager* top_controls_manager() { |
| 304 | return top_controls_manager_.get(); |
| 305 | } |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 306 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 307 | Proxy* proxy() const { return proxy_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 308 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 309 | AnimationRegistrar* animation_registrar() const { |
| 310 | return animation_registrar_.get(); |
| 311 | } |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 312 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 313 | void SetDebugState(const LayerTreeDebugState& debug_state); |
| 314 | const LayerTreeDebugState& debug_state() const { return debug_state_; } |
[email protected] | f511afb | 2012-11-30 01:55:20 | [diff] [blame] | 315 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 316 | class CC_EXPORT CullRenderPassesWithCachedTextures { |
| 317 | public: |
| 318 | bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
| 319 | const FrameData& frame) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 320 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 321 | // Iterates from the root first, in order to remove the surfaces closest |
| 322 | // to the root with cached textures, and all surfaces that draw into |
| 323 | // them. |
| 324 | size_t RenderPassListBegin(const RenderPassList& list) const { |
| 325 | return list.size() - 1; |
| 326 | } |
| 327 | size_t RenderPassListEnd(const RenderPassList& list) const { return 0 - 1; } |
| 328 | size_t RenderPassListNext(size_t it) const { return it - 1; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 329 | |
[email protected] | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 330 | explicit CullRenderPassesWithCachedTextures(Renderer* renderer) |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 331 | : renderer_(renderer) {} |
| 332 | private: |
[email protected] | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 333 | Renderer* renderer_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 334 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 335 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 336 | class CC_EXPORT CullRenderPassesWithNoQuads { |
| 337 | public: |
| 338 | bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
| 339 | const FrameData& frame) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 340 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 341 | // Iterates in draw order, so that when a surface is removed, and its |
| 342 | // target becomes empty, then its target can be removed also. |
| 343 | size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } |
| 344 | size_t RenderPassListEnd(const RenderPassList& list) const { |
| 345 | return list.size(); |
| 346 | } |
| 347 | size_t RenderPassListNext(size_t it) const { return it + 1; } |
| 348 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 349 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 350 | template <typename RenderPassCuller> |
| 351 | static void RemoveRenderPasses(RenderPassCuller culler, FrameData* frame); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 352 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 353 | skia::RefPtr<SkPicture> CapturePicture(); |
[email protected] | b9dcf43a | 2013-01-09 00:15:29 | [diff] [blame] | 354 | |
[email protected] | a2b5ded | 2013-05-20 21:32:53 | [diff] [blame] | 355 | gfx::Vector2dF accumulated_root_overscroll() const { |
| 356 | return accumulated_root_overscroll_; |
| 357 | } |
| 358 | gfx::Vector2dF current_fling_velocity() const { |
| 359 | return current_fling_velocity_; |
| 360 | } |
| 361 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 362 | bool pinch_gesture_active() const { return pinch_gesture_active_; } |
[email protected] | 166db5c8 | 2013-01-09 23:54:31 | [diff] [blame] | 363 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 364 | void SetTreePriority(TreePriority priority); |
[email protected] | 362f1e8b | 2013-01-21 16:54:30 | [diff] [blame] | 365 | |
[email protected] | 8347d69 | 2013-05-17 23:22:38 | [diff] [blame] | 366 | void ResetCurrentFrameTimeForNextFrame(); |
[email protected] | fb7425a | 2013-04-22 16:28:55 | [diff] [blame] | 367 | base::TimeTicks CurrentFrameTimeTicks(); |
| 368 | base::Time CurrentFrameTime(); |
[email protected] | 829ad97 | 2013-01-28 23:36:10 | [diff] [blame] | 369 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 370 | scoped_ptr<base::Value> AsValue() const; |
| 371 | scoped_ptr<base::Value> ActivationStateAsValue() const; |
[email protected] | 131a0c2 | 2013-02-12 18:31:08 | [diff] [blame] | 372 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 373 | bool page_scale_animation_active() const { return !!page_scale_animation_; } |
[email protected] | 498ddd0 | 2013-02-28 23:59:25 | [diff] [blame] | 374 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 375 | protected: |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 376 | LayerTreeHostImpl( |
| 377 | const LayerTreeSettings& settings, |
| 378 | LayerTreeHostImplClient* client, |
| 379 | Proxy* proxy, |
| 380 | RenderingStatsInstrumentation* rendering_stats_instrumentation); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 381 | void ActivatePendingTree(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 382 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 383 | // Virtual for testing. |
| 384 | virtual void AnimateLayers(base::TimeTicks monotonic_time, |
| 385 | base::Time wall_clock_time); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 386 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 387 | // Virtual for testing. |
| 388 | virtual base::TimeDelta LowFrequencyAnimationInterval() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 389 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 390 | const AnimationRegistrar::AnimationControllerMap& |
| 391 | active_animation_controllers() const { |
| 392 | return animation_registrar_->active_animation_controllers(); |
| 393 | } |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 394 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 395 | LayerTreeHostImplClient* client_; |
| 396 | Proxy* proxy_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 397 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 398 | private: |
| 399 | void AnimatePageScale(base::TimeTicks monotonic_time); |
| 400 | void AnimateScrollbars(base::TimeTicks monotonic_time); |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 401 | void AnimateTopControls(base::TimeTicks monotonic_time); |
[email protected] | 2d69299 | 2012-12-19 01:19:32 | [diff] [blame] | 402 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 403 | gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 404 | LayerImpl* layer_impl, |
| 405 | float scale_from_viewport_to_screen_space, |
| 406 | gfx::PointF viewport_point, |
| 407 | gfx::Vector2dF viewport_delta); |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 408 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 409 | void UpdateMaxScrollOffset(); |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 410 | void TrackDamageForAllSurfaces( |
| 411 | LayerImpl* root_draw_layer, |
| 412 | const LayerImplList& render_surface_layer_list); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 413 | |
[email protected] | 8be1a9bf | 2013-05-01 03:45:19 | [diff] [blame] | 414 | void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); |
| 415 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 416 | // Returns false if the frame should not be displayed. This function should |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 417 | // only be called from PrepareToDraw, as DidDrawAllLayers must be called |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 418 | // if this helper function is called. |
| 419 | bool CalculateRenderPasses(FrameData* frame); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 420 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 421 | void SendDidLoseOutputSurfaceRecursive(LayerImpl* current); |
| 422 | void ClearRenderSurfaces(); |
| 423 | bool EnsureRenderSurfaceLayerList(); |
| 424 | void ClearCurrentlyScrollingLayer(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 425 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 426 | void AnimateScrollbarsRecursive(LayerImpl* layer, |
| 427 | base::TimeTicks time); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 428 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 429 | void DumpRenderSurfaces(std::string* str, |
| 430 | int indent, |
| 431 | const LayerImpl* layer) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 432 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 433 | static LayerImpl* GetNonCompositedContentLayerRecursive(LayerImpl* layer); |
[email protected] | b9dcf43a | 2013-01-09 00:15:29 | [diff] [blame] | 434 | |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 435 | void StartScrollbarAnimationRecursive(LayerImpl* layer, base::TimeTicks time); |
| 436 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 437 | scoped_ptr<OutputSurface> output_surface_; |
[email protected] | fbe89f7 | 2013-05-21 07:24:24 | [diff] [blame] | 438 | |
| 439 | // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
| 440 | // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 441 | scoped_ptr<ResourceProvider> resource_provider_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 442 | scoped_ptr<TileManager> tile_manager_; |
[email protected] | fbe89f7 | 2013-05-21 07:24:24 | [diff] [blame] | 443 | scoped_ptr<Renderer> renderer_; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 444 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 445 | // Tree currently being drawn. |
| 446 | scoped_ptr<LayerTreeImpl> active_tree_; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 447 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 448 | // In impl-side painting mode, tree with possibly incomplete rasterized |
| 449 | // content. May be promoted to active by ActivatePendingTreeIfNeeded(). |
| 450 | scoped_ptr<LayerTreeImpl> pending_tree_; |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 451 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 452 | // In impl-side painting mode, inert tree with layers that can be recycled |
| 453 | // by the next sync from the main thread. |
| 454 | scoped_ptr<LayerTreeImpl> recycle_tree_; |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 455 | |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 456 | InputHandlerClient* input_handler_client_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 457 | bool did_lock_scrolling_layer_; |
| 458 | bool should_bubble_scrolls_; |
| 459 | bool wheel_scrolling_; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 460 | // The optional delegate for the root layer scroll offset. |
| 461 | LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 462 | LayerTreeSettings settings_; |
| 463 | LayerTreeDebugState debug_state_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 464 | gfx::Size device_viewport_size_; |
[email protected] | d908376 | 2013-03-24 01:36:40 | [diff] [blame] | 465 | float overdraw_bottom_height_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 466 | float device_scale_factor_; |
| 467 | bool visible_; |
| 468 | ManagedMemoryPolicy managed_memory_policy_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 469 | |
[email protected] | a2b5ded | 2013-05-20 21:32:53 | [diff] [blame] | 470 | gfx::Vector2dF accumulated_root_overscroll_; |
[email protected] | 6e921bd | 2013-04-29 21:10:20 | [diff] [blame] | 471 | gfx::Vector2dF current_fling_velocity_; |
| 472 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 473 | bool pinch_gesture_active_; |
| 474 | gfx::Point previous_pinch_anchor_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 475 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 476 | // This is set by AnimateLayers() and used by UpdateAnimationState() |
| 477 | // when sending animation events to the main thread. |
| 478 | base::Time last_animation_time_; |
[email protected] | 6ad55bb2 | 2013-02-08 21:34:33 | [diff] [blame] | 479 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 480 | scoped_ptr<TopControlsManager> top_controls_manager_; |
[email protected] | 3ba4cae | 2013-01-16 03:58:38 | [diff] [blame] | 481 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 482 | scoped_ptr<PageScaleAnimation> page_scale_animation_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 483 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 484 | // This is used for ticking animations slowly when hidden. |
| 485 | scoped_ptr<LayerTreeHostImplTimeSourceAdapter> time_source_client_adapter_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 486 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 487 | scoped_ptr<FrameRateCounter> fps_counter_; |
| 488 | scoped_ptr<PaintTimeCounter> paint_time_counter_; |
| 489 | scoped_ptr<MemoryHistory> memory_history_; |
| 490 | scoped_ptr<DebugRectHistory> debug_rect_history_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 491 | |
[email protected] | d7626ffd | 2013-03-29 00:17:42 | [diff] [blame] | 492 | // The maximum memory that would be used by the prioritized resource |
| 493 | // manager, if there were no limit on memory usage. |
| 494 | size_t max_memory_needed_bytes_; |
| 495 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 496 | size_t last_sent_memory_visible_bytes_; |
| 497 | size_t last_sent_memory_visible_and_nearby_bytes_; |
| 498 | size_t last_sent_memory_use_bytes_; |
[email protected] | d3afa11 | 2012-12-08 06:24:28 | [diff] [blame] | 499 | |
[email protected] | 878705be | 2013-04-15 22:44:02 | [diff] [blame] | 500 | gfx::Rect viewport_damage_rect_; |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 501 | |
[email protected] | fb7425a | 2013-04-22 16:28:55 | [diff] [blame] | 502 | base::TimeTicks current_frame_timeticks_; |
| 503 | base::Time current_frame_time_; |
[email protected] | 829ad97 | 2013-01-28 23:36:10 | [diff] [blame] | 504 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 505 | scoped_ptr<AnimationRegistrar> animation_registrar_; |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 506 | |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 507 | RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 508 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 509 | DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 510 | }; |
| 511 | |
[email protected] | 0023e8b | 2012-10-15 12:52:45 | [diff] [blame] | 512 | } // namespace cc |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 513 | |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 514 | #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |