[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] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 8 | #include <list> |
[email protected] | 127bdc1a | 2013-09-11 01:44:48 | [diff] [blame] | 9 | #include <set> |
[email protected] | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 10 | #include <string> |
| 11 | #include <vector> |
| 12 | |
[email protected] | c4040a52 | 2012-10-21 15:01:40 | [diff] [blame] | 13 | #include "base/basictypes.h" |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 14 | #include "base/containers/hash_tables.h" |
[email protected] | c4040a52 | 2012-10-21 15:01:40 | [diff] [blame] | 15 | #include "base/memory/scoped_ptr.h" |
[email protected] | 1b0df50 | 2013-06-27 23:39:58 | [diff] [blame] | 16 | #include "base/time/time.h" |
[email protected] | 95e4e1a0 | 2013-03-18 07:09:09 | [diff] [blame] | 17 | #include "cc/animation/animation_events.h" |
| 18 | #include "cc/animation/animation_registrar.h" |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 19 | #include "cc/animation/scrollbar_animation_controller.h" |
[email protected] | 681ccff | 2013-03-18 06:13:52 | [diff] [blame] | 20 | #include "cc/base/cc_export.h" |
[email protected] | 5e5648a | 2013-11-18 00:39:33 | [diff] [blame] | 21 | #include "cc/debug/micro_benchmark_controller_impl.h" |
[email protected] | 3052b10f | 2013-03-18 07:41:21 | [diff] [blame] | 22 | #include "cc/input/input_handler.h" |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 23 | #include "cc/input/layer_scroll_offset_delegate.h" |
[email protected] | 3052b10f | 2013-03-18 07:41:21 | [diff] [blame] | 24 | #include "cc/input/top_controls_manager_client.h" |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 25 | #include "cc/layers/layer_lists.h" |
[email protected] | cc3cfaa | 2013-03-18 09:05:52 | [diff] [blame] | 26 | #include "cc/layers/render_pass_sink.h" |
[email protected] | df3c24c9 | 2013-06-19 03:54:35 | [diff] [blame] | 27 | #include "cc/output/begin_frame_args.h" |
[email protected] | fd32d12 | 2013-06-29 13:11:04 | [diff] [blame] | 28 | #include "cc/output/managed_memory_policy.h" |
[email protected] | 7f0d825f | 2013-03-18 07:24:30 | [diff] [blame] | 29 | #include "cc/output/output_surface_client.h" |
| 30 | #include "cc/output/renderer.h" |
[email protected] | 89e8267a | 2013-03-18 07:50:56 | [diff] [blame] | 31 | #include "cc/quads/render_pass.h" |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 32 | #include "cc/resources/resource_provider.h" |
[email protected] | e12dd0e | 2013-03-18 08:24:40 | [diff] [blame] | 33 | #include "cc/resources/tile_manager.h" |
mithro | c34fc0b1 | 2014-09-30 09:10:41 | [diff] [blame] | 34 | #include "cc/scheduler/begin_frame_source.h" |
[email protected] | 30d8214 | 2014-05-12 04:26:02 | [diff] [blame] | 35 | #include "cc/scheduler/draw_result.h" |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 36 | #include "skia/ext/refptr.h" |
[email protected] | ddf9df8 | 2012-10-16 06:52:46 | [diff] [blame] | 37 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 167ed9d5 | 2012-10-31 20:47:58 | [diff] [blame] | 38 | #include "ui/gfx/rect.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 39 | |
| 40 | namespace cc { |
| 41 | |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 42 | class CompletionEvent; |
[email protected] | bf189f6 | 2012-12-18 03:42:11 | [diff] [blame] | 43 | class CompositorFrameMetadata; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 44 | class DebugRectHistory; |
[email protected] | bf05058 | 2014-07-24 11:10:58 | [diff] [blame] | 45 | class EvictionTilePriorityQueue; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 46 | class FrameRateCounter; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 47 | class LayerImpl; |
| 48 | class LayerTreeHostImplTimeSourceAdapter; |
[email protected] | 8bef4057 | 2012-12-11 21:38:08 | [diff] [blame] | 49 | class LayerTreeImpl; |
[email protected] | ec7541d | 2014-04-09 01:23:53 | [diff] [blame] | 50 | class MemoryHistory; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 51 | class PageScaleAnimation; |
[email protected] | 0edbfbe9f | 2013-01-17 03:33:03 | [diff] [blame] | 52 | class PaintTimeCounter; |
[email protected] | 8aa39ecb | 2014-06-12 14:19:14 | [diff] [blame] | 53 | class PictureLayerImpl; |
[email protected] | bf05058 | 2014-07-24 11:10:58 | [diff] [blame] | 54 | class RasterTilePriorityQueue; |
[email protected] | 7beac1b5 | 2014-04-10 23:09:56 | [diff] [blame] | 55 | class RasterWorkerPool; |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 56 | class RenderPassDrawQuad; |
[email protected] | ec7541d | 2014-04-09 01:23:53 | [diff] [blame] | 57 | class RenderingStatsInstrumentation; |
[email protected] | eece11e | 2014-04-12 03:07:16 | [diff] [blame] | 58 | class ResourcePool; |
[email protected] | bf1cfd9a | 2013-09-26 05:43:02 | [diff] [blame] | 59 | class ScrollbarLayerImplBase; |
[email protected] | ea468c6c | 2013-09-10 08:25:11 | [diff] [blame] | 60 | class TextureMailboxDeleter; |
[email protected] | 3ba4cae | 2013-01-16 03:58:38 | [diff] [blame] | 61 | class TopControlsManager; |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 62 | class UIResourceBitmap; |
[email protected] | 741fba42 | 2013-09-20 03:34:14 | [diff] [blame] | 63 | class UIResourceRequest; |
[email protected] | 7a8bcd26 | 2014-01-15 12:54:58 | [diff] [blame] | 64 | struct RendererCapabilitiesImpl; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 65 | |
[email protected] | 96baf3e | 2012-10-22 23:09:55 | [diff] [blame] | 66 | // LayerTreeHost->Proxy callback interface. |
| 67 | class LayerTreeHostImplClient { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 68 | public: |
[email protected] | fa33903 | 2014-02-18 22:11:59 | [diff] [blame] | 69 | virtual void UpdateRendererCapabilitiesOnImplThread() = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 70 | virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
[email protected] | 3dc0c77 | 2014-04-26 10:06:05 | [diff] [blame] | 71 | virtual void CommitVSyncParameters(base::TimeTicks timebase, |
| 72 | base::TimeDelta interval) = 0; |
| 73 | virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; |
[email protected] | c1490266 | 2014-04-18 05:06:11 | [diff] [blame] | 74 | virtual void SetMaxSwapsPendingOnImplThread(int max) = 0; |
[email protected] | 4d7e46a | 2013-11-08 05:33:40 | [diff] [blame] | 75 | virtual void DidSwapBuffersOnImplThread() = 0; |
[email protected] | c1490266 | 2014-04-18 05:06:11 | [diff] [blame] | 76 | virtual void DidSwapBuffersCompleteOnImplThread() = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 77 | virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
[email protected] | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 78 | virtual void NotifyReadyToActivate() = 0; |
[email protected] | 43b8f98 | 2014-04-30 21:24:33 | [diff] [blame] | 79 | // Please call these 3 functions through |
| 80 | // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and |
| 81 | // SetNeedsAnimate(). |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 82 | virtual void SetNeedsRedrawOnImplThread() = 0; |
[email protected] | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame] | 83 | virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; |
[email protected] | 43b8f98 | 2014-04-30 21:24:33 | [diff] [blame] | 84 | virtual void SetNeedsAnimateOnImplThread() = 0; |
[email protected] | 8612679 | 2013-03-16 20:07:54 | [diff] [blame] | 85 | virtual void DidInitializeVisibleTileOnImplThread() = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 86 | virtual void SetNeedsCommitOnImplThread() = 0; |
[email protected] | c48536a5 | 2013-09-14 00:02:08 | [diff] [blame] | 87 | virtual void SetNeedsManageTilesOnImplThread() = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 88 | virtual void PostAnimationEventsToMainThreadOnImplThread( |
[email protected] | 85b5750 | 2014-03-11 15:37:48 | [diff] [blame] | 89 | scoped_ptr<AnimationEventsVector> events) = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 90 | // Returns true if resources were deleted by this call. |
| 91 | virtual bool ReduceContentsTextureMemoryOnImplThread( |
| 92 | size_t limit_bytes, |
| 93 | int priority_cutoff) = 0; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 94 | virtual bool IsInsideDraw() = 0; |
| 95 | virtual void RenewTreePriority() = 0; |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 96 | virtual void PostDelayedScrollbarFadeOnImplThread( |
| 97 | const base::Closure& start_fade, |
| 98 | base::TimeDelta delay) = 0; |
[email protected] | fc20d14 | 2014-07-01 00:49:15 | [diff] [blame] | 99 | virtual void DidActivateSyncTree() = 0; |
[email protected] | bac0e55 | 2013-11-05 22:38:51 | [diff] [blame] | 100 | virtual void DidManageTiles() = 0; |
[email protected] | bf691c2 | 2013-03-26 21:15:06 | [diff] [blame] | 101 | |
| 102 | protected: |
| 103 | virtual ~LayerTreeHostImplClient() {} |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 104 | }; |
| 105 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 106 | // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 107 | // state. |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 108 | class CC_EXPORT LayerTreeHostImpl |
| 109 | : public InputHandler, |
| 110 | public RendererClient, |
| 111 | public TileManagerClient, |
| 112 | public OutputSurfaceClient, |
| 113 | public TopControlsManagerClient, |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 114 | public ScrollbarAnimationControllerClient, |
mithro | c34fc0b1 | 2014-09-30 09:10:41 | [diff] [blame] | 115 | public BeginFrameSourceMixIn, |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 116 | public base::SupportsWeakPtr<LayerTreeHostImpl> { |
[email protected] | e216fef0 | 2013-03-20 22:56:10 | [diff] [blame] | 117 | public: |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 118 | static scoped_ptr<LayerTreeHostImpl> Create( |
| 119 | const LayerTreeSettings& settings, |
| 120 | LayerTreeHostImplClient* client, |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 121 | Proxy* proxy, |
[email protected] | a7f3568 | 2013-10-22 23:05:57 | [diff] [blame] | 122 | RenderingStatsInstrumentation* rendering_stats_instrumentation, |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 123 | SharedBitmapManager* shared_bitmap_manager, |
| 124 | GpuMemoryBufferManager* gpu_memory_buffer_manager, |
[email protected] | dbe759a | 2013-12-02 19:23:02 | [diff] [blame] | 125 | int id); |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 126 | ~LayerTreeHostImpl() override; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 127 | |
mithro | c34fc0b1 | 2014-09-30 09:10:41 | [diff] [blame] | 128 | // BeginFrameSourceMixIn implementation |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 129 | void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
mithro | c34fc0b1 | 2014-09-30 09:10:41 | [diff] [blame] | 130 | |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 131 | // InputHandler implementation |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 132 | void BindToClient(InputHandlerClient* client) override; |
| 133 | InputHandler::ScrollStatus ScrollBegin( |
[email protected] | 47a723f | 2014-03-05 12:42:49 | [diff] [blame] | 134 | const gfx::Point& viewport_point, |
mostynb | f68776d8 | 2014-10-06 18:07:37 | [diff] [blame] | 135 | InputHandler::ScrollInputType type) override; |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 136 | InputHandler::ScrollStatus ScrollAnimated( |
[email protected] | 749cbc6 | 2014-07-10 01:06:35 | [diff] [blame] | 137 | const gfx::Point& viewport_point, |
mostynb | f68776d8 | 2014-10-06 18:07:37 | [diff] [blame] | 138 | const gfx::Vector2dF& scroll_delta) override; |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 139 | bool ScrollBy(const gfx::Point& viewport_point, |
| 140 | const gfx::Vector2dF& scroll_delta) override; |
| 141 | bool ScrollVerticallyByPage(const gfx::Point& viewport_point, |
| 142 | ScrollDirection direction) override; |
| 143 | void SetRootLayerScrollOffsetDelegate( |
mostynb | f68776d8 | 2014-10-06 18:07:37 | [diff] [blame] | 144 | LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 145 | void OnRootLayerDelegatedScrollOffsetChanged() override; |
| 146 | void ScrollEnd() override; |
| 147 | InputHandler::ScrollStatus FlingScrollBegin() override; |
| 148 | void MouseMoveAt(const gfx::Point& viewport_point) override; |
| 149 | void PinchGestureBegin() override; |
| 150 | void PinchGestureUpdate(float magnify_delta, |
| 151 | const gfx::Point& anchor) override; |
| 152 | void PinchGestureEnd() override; |
| 153 | void SetNeedsAnimate() override; |
| 154 | bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, |
| 155 | InputHandler::ScrollInputType type) override; |
| 156 | bool HaveTouchEventHandlersAt(const gfx::Point& viewport_port) override; |
| 157 | scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
mostynb | f68776d8 | 2014-10-06 18:07:37 | [diff] [blame] | 158 | ui::LatencyInfo* latency) override; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 159 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 160 | // TopControlsManagerClient implementation. |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 161 | void SetControlsTopOffset(float offset) override; |
| 162 | float ControlsTopOffset() const override; |
| 163 | void DidChangeTopControlsPosition() override; |
| 164 | bool HaveRootScrollLayer() const override; |
[email protected] | 3ba4cae | 2013-01-16 03:58:38 | [diff] [blame] | 165 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 166 | struct CC_EXPORT FrameData : public RenderPassSink { |
| 167 | FrameData(); |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 168 | ~FrameData() override; |
[email protected] | d12aa93 | 2014-08-01 13:10:38 | [diff] [blame] | 169 | void AsValueInto(base::debug::TracedValue* value) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 170 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 171 | std::vector<gfx::Rect> occluding_screen_space_rects; |
| 172 | std::vector<gfx::Rect> non_occluding_screen_space_rects; |
| 173 | RenderPassList render_passes; |
| 174 | RenderPassIdHashMap render_passes_by_id; |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 175 | const LayerImplList* render_surface_layer_list; |
| 176 | LayerImplList will_draw_layers; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 177 | bool contains_incomplete_tile; |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 178 | bool has_no_damage; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 179 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 180 | // RenderPassSink implementation. |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 181 | void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 182 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 183 | |
[email protected] | 097a0cbf | 2013-12-12 17:04:58 | [diff] [blame] | 184 | virtual void BeginMainFrameAborted(bool did_handle); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 185 | virtual void BeginCommit(); |
| 186 | virtual void CommitComplete(); |
[email protected] | 2715264 | 2014-03-11 20:42:00 | [diff] [blame] | 187 | virtual void Animate(base::TimeTicks monotonic_time); |
[email protected] | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 188 | virtual void UpdateAnimationState(bool start_ready_animations); |
[email protected] | b33348f | 2014-04-30 18:17:34 | [diff] [blame] | 189 | void ActivateAnimations(); |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 190 | void MainThreadHasStoppedFlinging(); |
[email protected] | 3d9f743 | 2013-04-06 00:35:18 | [diff] [blame] | 191 | void UpdateBackgroundAnimateTicking(bool should_background_tick); |
[email protected] | b8384e2 | 2013-12-03 02:20:48 | [diff] [blame] | 192 | void DidAnimateScrollOffset(); |
[email protected] | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame] | 193 | void SetViewportDamage(const gfx::Rect& damage_rect); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 194 | |
[email protected] | c48536a5 | 2013-09-14 00:02:08 | [diff] [blame] | 195 | virtual void ManageTiles(); |
[email protected] | 8947cbe | 2012-11-28 05:27:43 | [diff] [blame] | 196 | |
[email protected] | 2aae9679 | 2014-05-15 23:10:50 | [diff] [blame] | 197 | // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
| 198 | // should try to avoid displaying the frame. If PrepareToDraw is called, |
| 199 | // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
| 200 | // called between the two. |
| 201 | virtual DrawResult PrepareToDraw(FrameData* frame); |
[email protected] | 2e316b27 | 2014-07-19 05:01:20 | [diff] [blame] | 202 | virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 203 | // Must be called if and only if PrepareToDraw was called. |
| 204 | void DidDrawAllLayers(const FrameData& frame); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 205 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 206 | const LayerTreeSettings& settings() const { return settings_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 207 | |
[email protected] | 0309ba5e0 | 2013-06-26 04:11:08 | [diff] [blame] | 208 | // Evict all textures by enforcing a memory policy with an allocation of 0. |
| 209 | void EvictTexturesForTesting(); |
| 210 | |
[email protected] | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 211 | // When blocking, this prevents client_->NotifyReadyToActivate() from being |
| 212 | // called. When disabled, it calls client_->NotifyReadyToActivate() |
| 213 | // immediately if any notifications had been blocked while blocking. |
| 214 | virtual void BlockNotifyReadyToActivateForTesting(bool block); |
| 215 | |
[email protected] | 425e533 | 2013-09-21 04:10:03 | [diff] [blame] | 216 | // This allows us to inject DidInitializeVisibleTile events for testing. |
| 217 | void DidInitializeVisibleTileForTesting(); |
| 218 | |
[email protected] | 34bff212 | 2014-05-16 04:09:34 | [diff] [blame] | 219 | // Resets all of the trees to an empty state. |
| 220 | void ResetTreesForTesting(); |
vmpstr | 7fceb77 | 2014-08-26 18:51:52 | [diff] [blame] | 221 | void ResetRecycleTreeForTesting(); |
[email protected] | 34bff212 | 2014-05-16 04:09:34 | [diff] [blame] | 222 | |
[email protected] | c05dfbb | 2014-07-10 22:49:04 | [diff] [blame] | 223 | DrawMode GetDrawMode() const; |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 224 | |
| 225 | // Viewport size in draw space: this size is in physical pixels and is used |
| 226 | // for draw properties, tilings, quads and render passes. |
| 227 | gfx::Size DrawViewportSize() const; |
| 228 | |
[email protected] | bd532459 | 2014-07-31 09:09:33 | [diff] [blame] | 229 | // Viewport rect in view space used for tiling prioritization. |
| 230 | const gfx::Rect ViewportRectForTilePriority() const; |
| 231 | |
[email protected] | 59fee30 | 2013-12-10 17:53:30 | [diff] [blame] | 232 | // RendererClient implementation. |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 233 | void SetFullRootLayerDamage() override; |
[email protected] | 8947cbe | 2012-11-28 05:27:43 | [diff] [blame] | 234 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 235 | // TileManagerClient implementation. |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 236 | const std::vector<PictureLayerImpl*>& GetPictureLayers() const override; |
| 237 | void NotifyReadyToActivate() override; |
| 238 | void NotifyTileStateChanged(const Tile* tile) override; |
| 239 | void BuildRasterQueue(RasterTilePriorityQueue* queue, |
| 240 | TreePriority tree_priority) override; |
| 241 | void BuildEvictionQueue(EvictionTilePriorityQueue* queue, |
| 242 | TreePriority tree_priority) override; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 243 | |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 244 | // ScrollbarAnimationControllerClient implementation. |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 245 | void PostDelayedScrollbarFade(const base::Closure& start_fade, |
| 246 | base::TimeDelta delay) override; |
| 247 | void SetNeedsScrollbarAnimationFrame() override; |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 248 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 249 | // OutputSurfaceClient implementation. |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 250 | void DeferredInitialize() override; |
| 251 | void ReleaseGL() override; |
| 252 | void CommitVSyncParameters(base::TimeTicks timebase, |
| 253 | base::TimeDelta interval) override; |
| 254 | void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
| 255 | void BeginFrame(const BeginFrameArgs& args) override; |
[email protected] | bd532459 | 2014-07-31 09:09:33 | [diff] [blame] | 256 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 257 | void SetExternalDrawConstraints( |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 258 | const gfx::Transform& transform, |
[email protected] | 0023fc7 | 2014-01-10 20:05:06 | [diff] [blame] | 259 | const gfx::Rect& viewport, |
| 260 | const gfx::Rect& clip, |
[email protected] | bd532459 | 2014-07-31 09:09:33 | [diff] [blame] | 261 | const gfx::Rect& viewport_rect_for_tile_priority, |
| 262 | const gfx::Transform& transform_for_tile_priority, |
mostynb | f68776d8 | 2014-10-06 18:07:37 | [diff] [blame] | 263 | bool resourceless_software_draw) override; |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 264 | void DidLoseOutputSurface() override; |
| 265 | void DidSwapBuffers() override; |
| 266 | void DidSwapBuffersComplete() override; |
| 267 | void ReclaimResources(const CompositorFrameAck* ack) override; |
| 268 | void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 269 | void SetTreeActivationCallback(const base::Closure& callback) override; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 270 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 271 | // Called from LayerTreeImpl. |
| 272 | void OnCanDrawStateChangedForTree(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 273 | |
[email protected] | b5174d71 | 2013-08-28 08:10:43 | [diff] [blame] | 274 | // Implementation. |
[email protected] | 12a63da | 2014-06-13 06:06:22 | [diff] [blame] | 275 | int id() const { return id_; } |
[email protected] | 6133cc23 | 2013-07-30 18:47:07 | [diff] [blame] | 276 | bool CanDraw() const; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 277 | OutputSurface* output_surface() const { return output_surface_.get(); } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 278 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 279 | std::string LayerTreeAsJson() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 280 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 281 | void FinishAllRendering(); |
| 282 | int SourceAnimationFrameNumber() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 283 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 284 | virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 285 | TileManager* tile_manager() { return tile_manager_.get(); } |
[email protected] | 13525d6 | 2014-05-20 21:22:04 | [diff] [blame] | 286 | void SetUseGpuRasterization(bool use_gpu); |
| 287 | bool use_gpu_rasterization() const { return use_gpu_rasterization_; } |
[email protected] | 473f1f2 | 2014-05-22 08:19:17 | [diff] [blame] | 288 | bool create_low_res_tiling() const { |
| 289 | return settings_.create_low_res_tiling && !use_gpu_rasterization_; |
| 290 | } |
[email protected] | b7635e0 | 2014-04-28 07:08:43 | [diff] [blame] | 291 | ResourcePool* resource_pool() { return resource_pool_.get(); } |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 292 | Renderer* renderer() { return renderer_.get(); } |
[email protected] | 7a8bcd26 | 2014-01-15 12:54:58 | [diff] [blame] | 293 | const RendererCapabilitiesImpl& GetRendererCapabilities() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 294 | |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 295 | virtual bool SwapBuffers(const FrameData& frame); |
[email protected] | 97e9ccd6 | 2014-04-12 01:07:15 | [diff] [blame] | 296 | virtual void WillBeginImplFrame(const BeginFrameArgs& args); |
[email protected] | c48536a5 | 2013-09-14 00:02:08 | [diff] [blame] | 297 | void DidModifyTilePriorities(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 298 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 299 | LayerTreeImpl* active_tree() { return active_tree_.get(); } |
| 300 | const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
| 301 | LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
| 302 | const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
[email protected] | 71618ed | 2014-07-24 02:23:45 | [diff] [blame] | 303 | LayerTreeImpl* recycle_tree() { return recycle_tree_.get(); } |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 304 | const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
[email protected] | 12a63da | 2014-06-13 06:06:22 | [diff] [blame] | 305 | // Returns the tree LTH synchronizes with. |
| 306 | LayerTreeImpl* sync_tree() { |
[email protected] | fc20d14 | 2014-07-01 00:49:15 | [diff] [blame] | 307 | return pending_tree_ ? pending_tree_.get() : active_tree_.get(); |
[email protected] | 12a63da | 2014-06-13 06:06:22 | [diff] [blame] | 308 | } |
[email protected] | 2f0d92f | 2013-06-11 04:07:20 | [diff] [blame] | 309 | virtual void CreatePendingTree(); |
[email protected] | 1e212c9bb | 2013-09-07 04:32:14 | [diff] [blame] | 310 | virtual void UpdateVisibleTiles(); |
[email protected] | fc20d14 | 2014-07-01 00:49:15 | [diff] [blame] | 311 | virtual void ActivateSyncTree(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 312 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 313 | // Shortcuts to layers on the active tree. |
| 314 | LayerImpl* RootLayer() const; |
[email protected] | adeda57 | 2014-01-31 00:49:47 | [diff] [blame] | 315 | LayerImpl* InnerViewportScrollLayer() const; |
| 316 | LayerImpl* OuterViewportScrollLayer() const; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 317 | LayerImpl* CurrentlyScrollingLayer() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 318 | |
[email protected] | f161ca9e | 2014-04-01 13:57:01 | [diff] [blame] | 319 | int scroll_layer_id_when_mouse_over_scrollbar() const { |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 320 | return scroll_layer_id_when_mouse_over_scrollbar_; |
| 321 | } |
[email protected] | f161ca9e | 2014-04-01 13:57:01 | [diff] [blame] | 322 | bool scroll_affects_scroll_handler() const { |
| 323 | return scroll_affects_scroll_handler_; |
| 324 | } |
[email protected] | dab0a42 | 2014-08-13 16:09:46 | [diff] [blame] | 325 | void QueueSwapPromiseForMainThreadScrollUpdate( |
| 326 | scoped_ptr<SwapPromise> swap_promise); |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 327 | |
[email protected] | 251699b | 2013-10-09 00:21:26 | [diff] [blame] | 328 | bool IsCurrentlyScrolling() const; |
| 329 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 330 | virtual void SetVisible(bool visible); |
| 331 | bool visible() const { return visible_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 332 | |
[email protected] | d7eb8c7 | 2013-03-23 22:57:13 | [diff] [blame] | 333 | void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } |
[email protected] | 6be422b | 2013-12-08 06:47:31 | [diff] [blame] | 334 | void SetNeedsRedraw(); |
[email protected] | d7eb8c7 | 2013-03-23 22:57:13 | [diff] [blame] | 335 | |
[email protected] | 206a392 | 2013-05-17 06:34:12 | [diff] [blame] | 336 | ManagedMemoryPolicy ActualManagedMemoryPolicy() const; |
| 337 | |
[email protected] | 3f2ff11 | 2013-08-03 02:41:07 | [diff] [blame] | 338 | size_t memory_allocation_limit_bytes() const; |
[email protected] | 990e050a | 2013-09-23 18:50:21 | [diff] [blame] | 339 | int memory_allocation_priority_cutoff() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 340 | |
[email protected] | 64348ea | 2014-01-29 22:58:26 | [diff] [blame] | 341 | void SetViewportSize(const gfx::Size& device_viewport_size); |
[email protected] | 4a6c091d | 2014-04-24 21:06:46 | [diff] [blame] | 342 | gfx::Size device_viewport_size() const { return device_viewport_size_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 343 | |
[email protected] | 9f4f6a3 | 2013-09-04 21:35:12 | [diff] [blame] | 344 | void SetOverhangUIResource(UIResourceId overhang_ui_resource_id, |
[email protected] | 64348ea | 2014-01-29 22:58:26 | [diff] [blame] | 345 | const gfx::Size& overhang_ui_resource_size); |
[email protected] | 9f4f6a3 | 2013-09-04 21:35:12 | [diff] [blame] | 346 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 347 | void SetDeviceScaleFactor(float device_scale_factor); |
| 348 | float device_scale_factor() const { return device_scale_factor_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 349 | |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 350 | const gfx::Transform& DrawTransform() const; |
[email protected] | f224cc9 | 2013-06-06 23:23:32 | [diff] [blame] | 351 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 352 | scoped_ptr<ScrollAndScaleSet> ProcessScrollDeltas(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 353 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 354 | bool needs_animate_layers() const { |
| 355 | return !animation_registrar_->active_animation_controllers().empty(); |
| 356 | } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 357 | |
[email protected] | d7626ffd | 2013-03-29 00:17:42 | [diff] [blame] | 358 | void set_max_memory_needed_bytes(size_t bytes) { |
| 359 | max_memory_needed_bytes_ = bytes; |
| 360 | } |
| 361 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 362 | FrameRateCounter* fps_counter() { |
| 363 | return fps_counter_.get(); |
| 364 | } |
| 365 | PaintTimeCounter* paint_time_counter() { |
| 366 | return paint_time_counter_.get(); |
| 367 | } |
| 368 | MemoryHistory* memory_history() { |
| 369 | return memory_history_.get(); |
| 370 | } |
| 371 | DebugRectHistory* debug_rect_history() { |
| 372 | return debug_rect_history_.get(); |
| 373 | } |
| 374 | ResourceProvider* resource_provider() { |
| 375 | return resource_provider_.get(); |
| 376 | } |
| 377 | TopControlsManager* top_controls_manager() { |
| 378 | return top_controls_manager_.get(); |
| 379 | } |
[email protected] | 4bb0f31 | 2014-02-25 02:02:32 | [diff] [blame] | 380 | const GlobalStateThatImpactsTilePriority& global_tile_state() { |
| 381 | return global_tile_state_; |
| 382 | } |
[email protected] | ff762fb | 2012-12-12 19:18:37 | [diff] [blame] | 383 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 384 | Proxy* proxy() const { return proxy_; } |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 385 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 386 | AnimationRegistrar* animation_registrar() const { |
| 387 | return animation_registrar_.get(); |
| 388 | } |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 389 | |
[email protected] | 6e7fdeb | 2013-07-09 14:28:38 | [diff] [blame] | 390 | void SetDebugState(const LayerTreeDebugState& new_debug_state); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 391 | const LayerTreeDebugState& debug_state() const { return debug_state_; } |
[email protected] | f511afb | 2012-11-30 01:55:20 | [diff] [blame] | 392 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 393 | class CC_EXPORT CullRenderPassesWithNoQuads { |
[email protected] | 30d8214 | 2014-05-12 04:26:02 | [diff] [blame] | 394 | public: |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 395 | bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
| 396 | const FrameData& frame) const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 397 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 398 | // Iterates in draw order, so that when a surface is removed, and its |
| 399 | // target becomes empty, then its target can be removed also. |
| 400 | size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } |
| 401 | size_t RenderPassListEnd(const RenderPassList& list) const { |
| 402 | return list.size(); |
| 403 | } |
| 404 | size_t RenderPassListNext(size_t it) const { return it + 1; } |
| 405 | }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 406 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 407 | template <typename RenderPassCuller> |
| 408 | static void RemoveRenderPasses(RenderPassCuller culler, FrameData* frame); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 409 | |
[email protected] | a2b5ded | 2013-05-20 21:32:53 | [diff] [blame] | 410 | gfx::Vector2dF accumulated_root_overscroll() const { |
| 411 | return accumulated_root_overscroll_; |
| 412 | } |
[email protected] | a2b5ded | 2013-05-20 21:32:53 | [diff] [blame] | 413 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 414 | bool pinch_gesture_active() const { return pinch_gesture_active_; } |
[email protected] | 166db5c8 | 2013-01-09 23:54:31 | [diff] [blame] | 415 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 416 | void SetTreePriority(TreePriority priority); |
vmpstr | 56ace23 | 2014-10-09 20:16:28 | [diff] [blame] | 417 | TreePriority GetTreePriority() const; |
[email protected] | 362f1e8b | 2013-01-21 16:54:30 | [diff] [blame] | 418 | |
[email protected] | 04c5900d | 2014-08-18 13:38:36 | [diff] [blame] | 419 | void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
| 420 | void ResetCurrentBeginFrameArgsForNextFrame(); |
| 421 | virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
[email protected] | 829ad97 | 2013-01-28 23:36:10 | [diff] [blame] | 422 | |
[email protected] | c92195e | 2014-05-07 18:18:49 | [diff] [blame] | 423 | // Expected time between two begin impl frame calls. |
| 424 | base::TimeDelta begin_impl_frame_interval() const { |
| 425 | return begin_impl_frame_interval_; |
| 426 | } |
| 427 | |
dcheng | 716bedf | 2014-10-21 09:51:08 | [diff] [blame^] | 428 | void AsValueInto(base::debug::TracedValue* value) const override; |
[email protected] | d12aa93 | 2014-08-01 13:10:38 | [diff] [blame] | 429 | void AsValueWithFrameInto(FrameData* frame, |
| 430 | base::debug::TracedValue* value) const; |
| 431 | scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 432 | scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
| 433 | FrameData* frame) const; |
| 434 | scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
| 435 | const; |
| 436 | void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
[email protected] | 131a0c2 | 2013-02-12 18:31:08 | [diff] [blame] | 437 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 438 | bool page_scale_animation_active() const { return !!page_scale_animation_; } |
[email protected] | 498ddd0 | 2013-02-28 23:59:25 | [diff] [blame] | 439 | |
[email protected] | 741fba42 | 2013-09-20 03:34:14 | [diff] [blame] | 440 | virtual void CreateUIResource(UIResourceId uid, |
| 441 | const UIResourceBitmap& bitmap); |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 442 | // Deletes a UI resource. May safely be called more than once. |
[email protected] | 741fba42 | 2013-09-20 03:34:14 | [diff] [blame] | 443 | virtual void DeleteUIResource(UIResourceId uid); |
[email protected] | 127bdc1a | 2013-09-11 01:44:48 | [diff] [blame] | 444 | void EvictAllUIResources(); |
| 445 | bool EvictedUIResourcesExist() const; |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 446 | |
[email protected] | 741fba42 | 2013-09-20 03:34:14 | [diff] [blame] | 447 | virtual ResourceProvider::ResourceId ResourceIdForUIResource( |
| 448 | UIResourceId uid) const; |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 449 | |
[email protected] | 709c954 | 2013-10-26 01:43:51 | [diff] [blame] | 450 | virtual bool IsUIResourceOpaque(UIResourceId uid) const; |
| 451 | |
[email protected] | efbdb3a | 2013-10-04 00:35:13 | [diff] [blame] | 452 | struct UIResourceData { |
| 453 | ResourceProvider::ResourceId resource_id; |
| 454 | gfx::Size size; |
[email protected] | 709c954 | 2013-10-26 01:43:51 | [diff] [blame] | 455 | bool opaque; |
[email protected] | efbdb3a | 2013-10-04 00:35:13 | [diff] [blame] | 456 | }; |
| 457 | |
[email protected] | 5e5648a | 2013-11-18 00:39:33 | [diff] [blame] | 458 | void ScheduleMicroBenchmark(scoped_ptr<MicroBenchmarkImpl> benchmark); |
| 459 | |
[email protected] | 4a28a61 | 2013-11-27 02:06:33 | [diff] [blame] | 460 | CompositorFrameMetadata MakeCompositorFrameMetadata() const; |
[email protected] | 59fee30 | 2013-12-10 17:53:30 | [diff] [blame] | 461 | // Viewport rectangle and clip in nonflipped window space. These rects |
| 462 | // should only be used by Renderer subclasses to populate glViewport/glClip |
| 463 | // and their software-mode equivalents. |
| 464 | gfx::Rect DeviceViewport() const; |
| 465 | gfx::Rect DeviceClip() const; |
[email protected] | 4a28a61 | 2013-11-27 02:06:33 | [diff] [blame] | 466 | |
[email protected] | 6be422b | 2013-12-08 06:47:31 | [diff] [blame] | 467 | // When a SwapPromiseMonitor is created on the impl thread, it calls |
| 468 | // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. |
| 469 | // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
| 470 | // to unregister itself. |
| 471 | void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
| 472 | void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
| 473 | |
[email protected] | 8aa39ecb | 2014-06-12 14:19:14 | [diff] [blame] | 474 | void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
| 475 | void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
| 476 | |
[email protected] | bf05058 | 2014-07-24 11:10:58 | [diff] [blame] | 477 | void GetPictureLayerImplPairs( |
| 478 | std::vector<PictureLayerImpl::Pair>* layers) const; |
| 479 | |
bokan | 88eae01 | 2014-09-09 20:40:42 | [diff] [blame] | 480 | void SetTopControlsLayoutHeight(float height); |
| 481 | |
vmpstr | 61ed94a1 | 2014-10-09 04:49:30 | [diff] [blame] | 482 | void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } |
| 483 | void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } |
| 484 | bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
| 485 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 486 | protected: |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 487 | LayerTreeHostImpl( |
| 488 | const LayerTreeSettings& settings, |
| 489 | LayerTreeHostImplClient* client, |
| 490 | Proxy* proxy, |
[email protected] | a7f3568 | 2013-10-22 23:05:57 | [diff] [blame] | 491 | RenderingStatsInstrumentation* rendering_stats_instrumentation, |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 492 | SharedBitmapManager* shared_bitmap_manager, |
| 493 | GpuMemoryBufferManager* gpu_memory_buffer_manager, |
[email protected] | dbe759a | 2013-12-02 19:23:02 | [diff] [blame] | 494 | int id); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 495 | |
bokan | ef97146 | 2014-10-13 22:58:32 | [diff] [blame] | 496 | void UpdateViewportContainerSizes(); |
[email protected] | fef74fd | 2014-02-27 06:28:17 | [diff] [blame] | 497 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 498 | // Virtual for testing. |
[email protected] | 2715264 | 2014-03-11 20:42:00 | [diff] [blame] | 499 | virtual void AnimateLayers(base::TimeTicks monotonic_time); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 500 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 501 | // Virtual for testing. |
| 502 | virtual base::TimeDelta LowFrequencyAnimationInterval() const; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 503 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 504 | const AnimationRegistrar::AnimationControllerMap& |
| 505 | active_animation_controllers() const { |
| 506 | return animation_registrar_->active_animation_controllers(); |
| 507 | } |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 508 | |
[email protected] | c48536a5 | 2013-09-14 00:02:08 | [diff] [blame] | 509 | bool manage_tiles_needed() const { return tile_priorities_dirty_; } |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 510 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 511 | LayerTreeHostImplClient* client_; |
| 512 | Proxy* proxy_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 513 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 514 | private: |
[email protected] | ced667b | 2014-05-22 21:49:53 | [diff] [blame] | 515 | void CreateAndSetRenderer(); |
| 516 | void CreateAndSetTileManager(); |
| 517 | void DestroyTileManager(); |
[email protected] | 5064464 | 2013-06-20 13:58:55 | [diff] [blame] | 518 | void ReleaseTreeResources(); |
| 519 | void EnforceZeroBudget(bool zero_budget); |
[email protected] | 2b154b2 | 2013-06-07 09:03:27 | [diff] [blame] | 520 | |
[email protected] | fc20d14 | 2014-07-01 00:49:15 | [diff] [blame] | 521 | bool UsePendingTreeForSync() const; |
reveman | 423e7da | 2014-09-23 16:57:44 | [diff] [blame] | 522 | bool UseZeroCopyRasterizer() const; |
| 523 | bool UseOneCopyRasterizer() const; |
[email protected] | ced667b | 2014-05-22 21:49:53 | [diff] [blame] | 524 | |
bokan | 59379b09 | 2014-09-29 13:47:21 | [diff] [blame] | 525 | // Scroll by preferring to move the outer viewport first, only moving the |
| 526 | // inner if the outer is at its scroll extents. |
[email protected] | adeda57 | 2014-01-31 00:49:47 | [diff] [blame] | 527 | void ScrollViewportBy(gfx::Vector2dF scroll_delta); |
bokan | 59379b09 | 2014-09-29 13:47:21 | [diff] [blame] | 528 | // Scroll by preferring to move the inner viewport first, only moving the |
| 529 | // outer if the inner is at its scroll extents. |
| 530 | void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 531 | void AnimatePageScale(base::TimeTicks monotonic_time); |
| 532 | void AnimateScrollbars(base::TimeTicks monotonic_time); |
[email protected] | ffb2720f | 2013-03-15 19:18:37 | [diff] [blame] | 533 | void AnimateTopControls(base::TimeTicks monotonic_time); |
[email protected] | 2d69299 | 2012-12-19 01:19:32 | [diff] [blame] | 534 | |
bokan | ef97146 | 2014-10-13 22:58:32 | [diff] [blame] | 535 | bool ShouldTopControlsConsumeScroll(const gfx::Vector2dF& scroll_delta) const; |
| 536 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 537 | gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( |
[email protected] | ed511b8d | 2013-03-25 03:29:29 | [diff] [blame] | 538 | LayerImpl* layer_impl, |
| 539 | float scale_from_viewport_to_screen_space, |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 540 | const gfx::PointF& viewport_point, |
[email protected] | 3244c913 | 2014-01-23 10:39:12 | [diff] [blame] | 541 | const gfx::Vector2dF& viewport_delta); |
[email protected] | 615c78a | 2013-01-24 23:44:16 | [diff] [blame] | 542 | |
[email protected] | 50761e9 | 2013-03-29 20:51:28 | [diff] [blame] | 543 | void TrackDamageForAllSurfaces( |
| 544 | LayerImpl* root_draw_layer, |
| 545 | const LayerImplList& render_surface_layer_list); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 546 | |
[email protected] | 8be1a9bf | 2013-05-01 03:45:19 | [diff] [blame] | 547 | void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); |
| 548 | |
[email protected] | 7ddfe7e8 | 2014-01-30 07:22:11 | [diff] [blame] | 549 | // This function should only be called from PrepareToDraw, as DidDrawAllLayers |
| 550 | // must be called if this helper function is called. Returns DRAW_SUCCESS if |
| 551 | // the frame should be drawn. |
[email protected] | 30d8214 | 2014-05-12 04:26:02 | [diff] [blame] | 552 | DrawResult CalculateRenderPasses(FrameData* frame); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 553 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 554 | void ClearCurrentlyScrollingLayer(); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 555 | |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 556 | bool HandleMouseOverScrollbar(LayerImpl* layer_impl, |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 557 | const gfx::PointF& device_viewport_point); |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 558 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 559 | void AnimateScrollbarsRecursive(LayerImpl* layer, |
| 560 | base::TimeTicks time); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 561 | |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 562 | LayerImpl* FindScrollLayerForDeviceViewportPoint( |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 563 | const gfx::PointF& device_viewport_point, |
[email protected] | bf1cfd9a | 2013-09-26 05:43:02 | [diff] [blame] | 564 | InputHandler::ScrollInputType type, |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 565 | LayerImpl* layer_hit_by_point, |
[email protected] | f161ca9e | 2014-04-01 13:57:01 | [diff] [blame] | 566 | bool* scroll_on_main_thread, |
[email protected] | edcc1a1 | 2014-05-06 01:26:39 | [diff] [blame] | 567 | bool* optional_has_ancestor_scroll_handler) const; |
[email protected] | 14bc5d68 | 2014-01-17 07:26:47 | [diff] [blame] | 568 | float DeviceSpaceDistanceToLayer(const gfx::PointF& device_viewport_point, |
[email protected] | bf1cfd9a | 2013-09-26 05:43:02 | [diff] [blame] | 569 | LayerImpl* layer_impl); |
[email protected] | 930ff43b | 2014-05-02 05:24:00 | [diff] [blame] | 570 | void StartScrollbarFadeRecursive(LayerImpl* layer); |
[email protected] | 3f2ff11 | 2013-08-03 02:41:07 | [diff] [blame] | 571 | void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy, |
| 572 | bool zero_budget); |
[email protected] | 0309ba5e0 | 2013-06-26 04:11:08 | [diff] [blame] | 573 | void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy); |
[email protected] | 0fc818e | 2013-03-18 06:45:20 | [diff] [blame] | 574 | |
[email protected] | 8bb6cfa | 2013-07-23 00:11:19 | [diff] [blame] | 575 | void DidInitializeVisibleTile(); |
| 576 | |
[email protected] | 127bdc1a | 2013-09-11 01:44:48 | [diff] [blame] | 577 | void MarkUIResourceNotEvicted(UIResourceId uid); |
| 578 | |
[email protected] | 6be422b | 2013-12-08 06:47:31 | [diff] [blame] | 579 | void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); |
[email protected] | dab0a42 | 2014-08-13 16:09:46 | [diff] [blame] | 580 | void NotifySwapPromiseMonitorsOfForwardingToMainThread(); |
[email protected] | 6be422b | 2013-12-08 06:47:31 | [diff] [blame] | 581 | |
[email protected] | efbdb3a | 2013-10-04 00:35:13 | [diff] [blame] | 582 | typedef base::hash_map<UIResourceId, UIResourceData> |
[email protected] | c928076 | 2013-08-01 06:28:57 | [diff] [blame] | 583 | UIResourceMap; |
| 584 | UIResourceMap ui_resource_map_; |
| 585 | |
[email protected] | 127bdc1a | 2013-09-11 01:44:48 | [diff] [blame] | 586 | // Resources that were evicted by EvictAllUIResources. Resources are removed |
| 587 | // from this when they are touched by a create or destroy from the UI resource |
| 588 | // request queue. |
| 589 | std::set<UIResourceId> evicted_ui_resources_; |
| 590 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 591 | scoped_ptr<OutputSurface> output_surface_; |
[email protected] | fbe89f7 | 2013-05-21 07:24:24 | [diff] [blame] | 592 | |
| 593 | // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
| 594 | // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 595 | scoped_ptr<ResourceProvider> resource_provider_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 596 | scoped_ptr<TileManager> tile_manager_; |
[email protected] | 13525d6 | 2014-05-20 21:22:04 | [diff] [blame] | 597 | bool use_gpu_rasterization_; |
[email protected] | 7beac1b5 | 2014-04-10 23:09:56 | [diff] [blame] | 598 | scoped_ptr<RasterWorkerPool> raster_worker_pool_; |
[email protected] | eece11e | 2014-04-12 03:07:16 | [diff] [blame] | 599 | scoped_ptr<ResourcePool> resource_pool_; |
[email protected] | 2cccfef | 2014-05-01 06:05:16 | [diff] [blame] | 600 | scoped_ptr<ResourcePool> staging_resource_pool_; |
[email protected] | fbe89f7 | 2013-05-21 07:24:24 | [diff] [blame] | 601 | scoped_ptr<Renderer> renderer_; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 602 | |
[email protected] | 1bcced2 | 2013-09-24 13:51:19 | [diff] [blame] | 603 | GlobalStateThatImpactsTilePriority global_tile_state_; |
| 604 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 605 | // Tree currently being drawn. |
| 606 | scoped_ptr<LayerTreeImpl> active_tree_; |
[email protected] | 3b31c6ac | 2012-12-06 21:27:29 | [diff] [blame] | 607 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 608 | // In impl-side painting mode, tree with possibly incomplete rasterized |
[email protected] | 4f48f6e | 2013-08-27 06:33:38 | [diff] [blame] | 609 | // content. May be promoted to active by ActivatePendingTree(). |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 610 | scoped_ptr<LayerTreeImpl> pending_tree_; |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 611 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 612 | // In impl-side painting mode, inert tree with layers that can be recycled |
| 613 | // by the next sync from the main thread. |
| 614 | scoped_ptr<LayerTreeImpl> recycle_tree_; |
[email protected] | 48871fc | 2013-01-23 07:36:51 | [diff] [blame] | 615 | |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 616 | InputHandlerClient* input_handler_client_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 617 | bool did_lock_scrolling_layer_; |
| 618 | bool should_bubble_scrolls_; |
| 619 | bool wheel_scrolling_; |
[email protected] | f161ca9e | 2014-04-01 13:57:01 | [diff] [blame] | 620 | bool scroll_affects_scroll_handler_; |
[email protected] | f620b0e7 | 2013-10-01 21:38:24 | [diff] [blame] | 621 | int scroll_layer_id_when_mouse_over_scrollbar_; |
[email protected] | dab0a42 | 2014-08-13 16:09:46 | [diff] [blame] | 622 | ScopedPtrVector<SwapPromise> swap_promises_for_main_thread_scroll_update_; |
[email protected] | a23451e | 2013-06-07 20:58:26 | [diff] [blame] | 623 | |
[email protected] | c48536a5 | 2013-09-14 00:02:08 | [diff] [blame] | 624 | bool tile_priorities_dirty_; |
[email protected] | a23451e | 2013-06-07 20:58:26 | [diff] [blame] | 625 | |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 626 | // The optional delegate for the root layer scroll offset. |
| 627 | LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 628 | LayerTreeSettings settings_; |
| 629 | LayerTreeDebugState debug_state_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 630 | bool visible_; |
[email protected] | 3f2ff11 | 2013-08-03 02:41:07 | [diff] [blame] | 631 | ManagedMemoryPolicy cached_managed_memory_policy_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 632 | |
[email protected] | a2b5ded | 2013-05-20 21:32:53 | [diff] [blame] | 633 | gfx::Vector2dF accumulated_root_overscroll_; |
[email protected] | 6e921bd | 2013-04-29 21:10:20 | [diff] [blame] | 634 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 635 | bool pinch_gesture_active_; |
[email protected] | 2fa342b8 | 2013-09-24 03:19:13 | [diff] [blame] | 636 | bool pinch_gesture_end_should_clear_scrolling_layer_; |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 637 | gfx::Point previous_pinch_anchor_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 638 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 639 | scoped_ptr<TopControlsManager> top_controls_manager_; |
[email protected] | 3ba4cae | 2013-01-16 03:58:38 | [diff] [blame] | 640 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 641 | scoped_ptr<PageScaleAnimation> page_scale_animation_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 642 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 643 | // This is used for ticking animations slowly when hidden. |
| 644 | scoped_ptr<LayerTreeHostImplTimeSourceAdapter> time_source_client_adapter_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 645 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 646 | scoped_ptr<FrameRateCounter> fps_counter_; |
| 647 | scoped_ptr<PaintTimeCounter> paint_time_counter_; |
| 648 | scoped_ptr<MemoryHistory> memory_history_; |
| 649 | scoped_ptr<DebugRectHistory> debug_rect_history_; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 650 | |
[email protected] | ea468c6c | 2013-09-10 08:25:11 | [diff] [blame] | 651 | scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
| 652 | |
[email protected] | d7626ffd | 2013-03-29 00:17:42 | [diff] [blame] | 653 | // The maximum memory that would be used by the prioritized resource |
| 654 | // manager, if there were no limit on memory usage. |
| 655 | size_t max_memory_needed_bytes_; |
| 656 | |
[email protected] | 5064464 | 2013-06-20 13:58:55 | [diff] [blame] | 657 | bool zero_budget_; |
[email protected] | d3afa11 | 2012-12-08 06:24:28 | [diff] [blame] | 658 | |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 659 | // Viewport size passed in from the main thread, in physical pixels. This |
| 660 | // value is the default size for all concepts of physical viewport (draw |
| 661 | // viewport, scrolling viewport and device viewport), but it can be |
| 662 | // overridden. |
[email protected] | f224cc9 | 2013-06-06 23:23:32 | [diff] [blame] | 663 | gfx::Size device_viewport_size_; |
| 664 | |
| 665 | // Conversion factor from CSS pixels to physical pixels when |
| 666 | // pageScaleFactor=1. |
| 667 | float device_scale_factor_; |
| 668 | |
[email protected] | 9f4f6a3 | 2013-09-04 21:35:12 | [diff] [blame] | 669 | // UI resource to use for drawing overhang gutters. |
| 670 | UIResourceId overhang_ui_resource_id_; |
| 671 | gfx::Size overhang_ui_resource_size_; |
| 672 | |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 673 | // Optional top-level constraints that can be set by the OutputSurface. |
| 674 | // - external_transform_ applies a transform above the root layer |
| 675 | // - external_viewport_ is used DrawProperties, tile management and |
| 676 | // glViewport/window projection matrix. |
| 677 | // - external_clip_ specifies a top-level clip rect |
[email protected] | bd532459 | 2014-07-31 09:09:33 | [diff] [blame] | 678 | // - viewport_rect_for_tile_priority_ is the rect in view space used for |
| 679 | // tiling priority. |
[email protected] | f224cc9 | 2013-06-06 23:23:32 | [diff] [blame] | 680 | gfx::Transform external_transform_; |
| 681 | gfx::Rect external_viewport_; |
[email protected] | 54af0352 | 2013-09-05 00:43:28 | [diff] [blame] | 682 | gfx::Rect external_clip_; |
[email protected] | bd532459 | 2014-07-31 09:09:33 | [diff] [blame] | 683 | gfx::Rect viewport_rect_for_tile_priority_; |
[email protected] | c05dfbb | 2014-07-10 22:49:04 | [diff] [blame] | 684 | bool resourceless_software_draw_; |
[email protected] | f224cc9 | 2013-06-06 23:23:32 | [diff] [blame] | 685 | |
[email protected] | 878705be | 2013-04-15 22:44:02 | [diff] [blame] | 686 | gfx::Rect viewport_damage_rect_; |
[email protected] | e034135 | 2013-04-06 05:01:20 | [diff] [blame] | 687 | |
[email protected] | 04c5900d | 2014-08-18 13:38:36 | [diff] [blame] | 688 | BeginFrameArgs current_begin_frame_args_; |
[email protected] | 829ad97 | 2013-01-28 23:36:10 | [diff] [blame] | 689 | |
[email protected] | c92195e | 2014-05-07 18:18:49 | [diff] [blame] | 690 | // Expected time between two begin impl frame calls. |
| 691 | base::TimeDelta begin_impl_frame_interval_; |
| 692 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 693 | scoped_ptr<AnimationRegistrar> animation_registrar_; |
[email protected] | de4afb5e | 2012-12-20 00:11:34 | [diff] [blame] | 694 | |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 695 | RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
[email protected] | 5e5648a | 2013-11-18 00:39:33 | [diff] [blame] | 696 | MicroBenchmarkControllerImpl micro_benchmark_controller_; |
[email protected] | 372bad5f | 2013-03-21 16:38:43 | [diff] [blame] | 697 | |
[email protected] | 8bb6cfa | 2013-07-23 00:11:19 | [diff] [blame] | 698 | bool need_to_update_visible_tiles_before_draw_; |
[email protected] | 39643fb | 2013-07-09 17:28:19 | [diff] [blame] | 699 | |
[email protected] | 5f07afc | 2013-07-19 05:17:18 | [diff] [blame] | 700 | // Optional callback to notify of new tree activations. |
[email protected] | 2022c67 | 2013-07-23 19:55:26 | [diff] [blame] | 701 | base::Closure tree_activation_callback_; |
[email protected] | 5f07afc | 2013-07-19 05:17:18 | [diff] [blame] | 702 | |
[email protected] | a7f3568 | 2013-10-22 23:05:57 | [diff] [blame] | 703 | SharedBitmapManager* shared_bitmap_manager_; |
reveman | 22dd929 | 2014-10-13 20:52:05 | [diff] [blame] | 704 | GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
[email protected] | dbe759a | 2013-12-02 19:23:02 | [diff] [blame] | 705 | int id_; |
[email protected] | a7f3568 | 2013-10-22 23:05:57 | [diff] [blame] | 706 | |
[email protected] | 6be422b | 2013-12-08 06:47:31 | [diff] [blame] | 707 | std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 708 | |
[email protected] | 8aa39ecb | 2014-06-12 14:19:14 | [diff] [blame] | 709 | std::vector<PictureLayerImpl*> picture_layers_; |
[email protected] | bf05058 | 2014-07-24 11:10:58 | [diff] [blame] | 710 | std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
[email protected] | 8aa39ecb | 2014-06-12 14:19:14 | [diff] [blame] | 711 | |
vmpstr | 61ed94a1 | 2014-10-09 04:49:30 | [diff] [blame] | 712 | bool requires_high_res_to_draw_; |
| 713 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 714 | DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 715 | }; |
| 716 | |
[email protected] | 0023e8b | 2012-10-15 12:52:45 | [diff] [blame] | 717 | } // namespace cc |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 718 | |
[email protected] | 556fd29 | 2013-03-18 08:03:04 | [diff] [blame] | 719 | #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |