| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "cc/layers/layer_collections.h" | 32 #include "cc/layers/layer_collections.h" |
| 33 #include "cc/layers/layer_list_iterator.h" | 33 #include "cc/layers/layer_list_iterator.h" |
| 34 #include "cc/output/output_surface.h" | 34 #include "cc/output/output_surface.h" |
| 35 #include "cc/output/swap_promise.h" | 35 #include "cc/output/swap_promise.h" |
| 36 #include "cc/resources/resource_format.h" | 36 #include "cc/resources/resource_format.h" |
| 37 #include "cc/resources/scoped_ui_resource.h" | 37 #include "cc/resources/scoped_ui_resource.h" |
| 38 #include "cc/surfaces/surface_sequence.h" | 38 #include "cc/surfaces/surface_sequence.h" |
| 39 #include "cc/trees/compositor_mode.h" | 39 #include "cc/trees/compositor_mode.h" |
| 40 #include "cc/trees/layer_tree.h" | 40 #include "cc/trees/layer_tree.h" |
| 41 #include "cc/trees/layer_tree_host_client.h" | 41 #include "cc/trees/layer_tree_host_client.h" |
| 42 #include "cc/trees/layer_tree_host_interface.h" |
| 42 #include "cc/trees/layer_tree_settings.h" | 43 #include "cc/trees/layer_tree_settings.h" |
| 43 #include "cc/trees/proxy.h" | 44 #include "cc/trees/proxy.h" |
| 44 #include "cc/trees/swap_promise_monitor.h" | 45 #include "cc/trees/swap_promise_monitor.h" |
| 45 #include "third_party/skia/include/core/SkColor.h" | 46 #include "third_party/skia/include/core/SkColor.h" |
| 46 #include "ui/gfx/geometry/rect.h" | 47 #include "ui/gfx/geometry/rect.h" |
| 47 | 48 |
| 48 namespace gpu { | 49 namespace gpu { |
| 49 class GpuMemoryBufferManager; | 50 class GpuMemoryBufferManager; |
| 50 } | 51 } |
| 51 | 52 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 74 class TopControlsManager; | 75 class TopControlsManager; |
| 75 class UIResourceRequest; | 76 class UIResourceRequest; |
| 76 struct PendingPageScaleAnimation; | 77 struct PendingPageScaleAnimation; |
| 77 struct RenderingStats; | 78 struct RenderingStats; |
| 78 struct ScrollAndScaleSet; | 79 struct ScrollAndScaleSet; |
| 79 | 80 |
| 80 namespace proto { | 81 namespace proto { |
| 81 class LayerTreeHost; | 82 class LayerTreeHost; |
| 82 } | 83 } |
| 83 | 84 |
| 84 class CC_EXPORT LayerTreeHost { | 85 // This class is being refactored to an interface, see LayerTreeHostInterface, |
| 86 // which is the API for the cc embedder. When adding new code to this class, |
| 87 // consider the following: |
| 88 // 1) If its state/data that gets pushed to the LayerTreeImpl during commit, add |
| 89 // it to the LayerTree. |
| 90 // 2) If it's a call from the embedder, add it to the LayerTreeHostInterface. |
| 91 // 3) If it's a call from any of the internal cc classes, i.e., LayerTree or |
| 92 // PropertyTreeBuilder, etc., add it to the LayerTreeHostInterface. |
| 93 // 4) If it's a notification from the impl thread or a call from Proxy, add it |
| 94 // to this class. |
| 95 // This class will be renamed to LayerTreeHostInProcess and will be the |
| 96 // LayerTreeHost implementation for when the impl thread for the compositor runs |
| 97 // in the same process, and thus uses a Proxy. |
| 98 class CC_EXPORT LayerTreeHost : public LayerTreeHostInterface { |
| 85 public: | 99 public: |
| 86 // TODO(sad): InitParams should be a movable type so that it can be | 100 // TODO(sad): InitParams should be a movable type so that it can be |
| 87 // std::move()d to the Create* functions. | 101 // std::move()d to the Create* functions. |
| 88 struct CC_EXPORT InitParams { | 102 struct CC_EXPORT InitParams { |
| 89 LayerTreeHostClient* client = nullptr; | 103 LayerTreeHostClient* client = nullptr; |
| 90 SharedBitmapManager* shared_bitmap_manager = nullptr; | 104 SharedBitmapManager* shared_bitmap_manager = nullptr; |
| 91 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; | 105 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr; |
| 92 TaskGraphRunner* task_graph_runner = nullptr; | 106 TaskGraphRunner* task_graph_runner = nullptr; |
| 93 LayerTreeSettings const* settings = nullptr; | 107 LayerTreeSettings const* settings = nullptr; |
| 94 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner; | 108 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner; |
| 95 std::unique_ptr<BeginFrameSource> external_begin_frame_source; | 109 std::unique_ptr<BeginFrameSource> external_begin_frame_source; |
| 96 ImageSerializationProcessor* image_serialization_processor = nullptr; | 110 ImageSerializationProcessor* image_serialization_processor = nullptr; |
| 97 std::unique_ptr<AnimationHost> animation_host; | 111 std::unique_ptr<AnimationHost> animation_host; |
| 98 | 112 |
| 99 InitParams(); | 113 InitParams(); |
| 100 ~InitParams(); | 114 ~InitParams(); |
| 101 }; | 115 }; |
| 102 | 116 |
| 103 // The SharedBitmapManager will be used on the compositor thread. | 117 // The SharedBitmapManager will be used on the compositor thread. |
| 104 static std::unique_ptr<LayerTreeHost> CreateThreaded( | 118 static std::unique_ptr<LayerTreeHostInterface> CreateThreaded( |
| 105 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 119 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 106 InitParams* params); | 120 InitParams* params); |
| 107 | 121 |
| 108 static std::unique_ptr<LayerTreeHost> CreateSingleThreaded( | 122 static std::unique_ptr<LayerTreeHost> CreateSingleThreaded( |
| 109 LayerTreeHostSingleThreadClient* single_thread_client, | 123 LayerTreeHostSingleThreadClient* single_thread_client, |
| 110 InitParams* params); | 124 InitParams* params); |
| 111 | 125 |
| 112 static std::unique_ptr<LayerTreeHost> CreateRemoteServer( | 126 static std::unique_ptr<LayerTreeHostInterface> CreateRemoteServer( |
| 113 RemoteProtoChannel* remote_proto_channel, | 127 RemoteProtoChannel* remote_proto_channel, |
| 114 InitParams* params); | 128 InitParams* params); |
| 115 | 129 |
| 116 // The lifetime of this LayerTreeHost is tied to the lifetime of the remote | 130 // The lifetime of this LayerTreeHost is tied to the lifetime of the remote |
| 117 // server LayerTreeHost. It should be created on receiving | 131 // server LayerTreeHost. It should be created on receiving |
| 118 // CompositorMessageToImpl::InitializeImpl message and destroyed on receiving | 132 // CompositorMessageToImpl::InitializeImpl message and destroyed on receiving |
| 119 // a CompositorMessageToImpl::CloseImpl message from the server. This ensures | 133 // a CompositorMessageToImpl::CloseImpl message from the server. This ensures |
| 120 // that the client will not send any compositor messages once the | 134 // that the client will not send any compositor messages once the |
| 121 // LayerTreeHost on the server is destroyed. | 135 // LayerTreeHost on the server is destroyed. |
| 122 static std::unique_ptr<LayerTreeHost> CreateRemoteClient( | 136 static std::unique_ptr<LayerTreeHostInterface> CreateRemoteClient( |
| 123 RemoteProtoChannel* remote_proto_channel, | 137 RemoteProtoChannel* remote_proto_channel, |
| 124 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 138 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 125 InitParams* params); | 139 InitParams* params); |
| 126 | 140 |
| 127 virtual ~LayerTreeHost(); | 141 ~LayerTreeHost() override; |
| 142 |
| 143 // LayerTreeHostInterface implementation. |
| 144 int GetId() const override; |
| 145 int SourceFrameNumber() const override; |
| 146 LayerTree* GetLayerTree() override; |
| 147 const LayerTree* GetLayerTree() const override; |
| 148 TaskRunnerProvider* GetTaskRunnerProvider() const override; |
| 149 const LayerTreeSettings& GetSettings() const override; |
| 150 void SetSurfaceClientId(uint32_t client_id) override; |
| 151 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator) override; |
| 152 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise) override; |
| 153 void SetHasGpuRasterizationTrigger(bool has_trigger) override; |
| 154 void SetVisible(bool visible) override; |
| 155 bool IsVisible() const override; |
| 156 void SetOutputSurface(std::unique_ptr<OutputSurface> output_surface) override; |
| 157 std::unique_ptr<OutputSurface> ReleaseOutputSurface() override; |
| 158 void SetNeedsAnimate() override; |
| 159 void SetNeedsUpdateLayers() override; |
| 160 void SetNeedsCommit() override; |
| 161 bool BeginMainFrameRequested() const override; |
| 162 bool CommitRequested() const override; |
| 163 void SetDeferCommits(bool defer_commits) override; |
| 164 void LayoutAndUpdateLayers() override; |
| 165 void Composite(base::TimeTicks frame_begin_time) override; |
| 166 void SetNeedsRedraw() override; |
| 167 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; |
| 168 void SetNextCommitForcesRedraw() override; |
| 169 void NotifyInputThrottledUntilCommit() override; |
| 170 void UpdateTopControlsState(TopControlsState constraints, |
| 171 TopControlsState current, |
| 172 bool animate) override; |
| 173 const base::WeakPtr<InputHandler>& GetInputHandler() const override; |
| 174 void DidStopFlinging() override; |
| 175 void SetDebugState(const LayerTreeDebugState& debug_state) override; |
| 176 const LayerTreeDebugState& GetDebugState() const override; |
| 177 int ScheduleMicroBenchmark( |
| 178 const std::string& benchmark_name, |
| 179 std::unique_ptr<base::Value> value, |
| 180 const MicroBenchmark::DoneCallback& callback) override; |
| 181 bool SendMessageToMicroBenchmark(int id, |
| 182 std::unique_ptr<base::Value> value) override; |
| 183 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) override; |
| 184 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) override; |
| 128 | 185 |
| 129 // LayerTreeHost interface to Proxy. | 186 // LayerTreeHost interface to Proxy. |
| 130 void WillBeginMainFrame(); | 187 void WillBeginMainFrame(); |
| 131 void DidBeginMainFrame(); | 188 void DidBeginMainFrame(); |
| 132 void BeginMainFrame(const BeginFrameArgs& args); | 189 void BeginMainFrame(const BeginFrameArgs& args); |
| 133 void BeginMainFrameNotExpectedSoon(); | 190 void BeginMainFrameNotExpectedSoon(); |
| 134 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); | 191 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); |
| 135 void DidStopFlinging(); | |
| 136 void RequestMainFrameUpdate(); | 192 void RequestMainFrameUpdate(); |
| 137 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); | 193 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); |
| 138 void WillCommit(); | 194 void WillCommit(); |
| 139 void CommitComplete(); | 195 void CommitComplete(); |
| 140 void SetOutputSurface(std::unique_ptr<OutputSurface> output_surface); | |
| 141 std::unique_ptr<OutputSurface> ReleaseOutputSurface(); | |
| 142 void RequestNewOutputSurface(); | 196 void RequestNewOutputSurface(); |
| 143 void DidInitializeOutputSurface(); | 197 void DidInitializeOutputSurface(); |
| 144 void DidFailToInitializeOutputSurface(); | 198 void DidFailToInitializeOutputSurface(); |
| 145 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 199 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
| 146 LayerTreeHostImplClient* client); | 200 LayerTreeHostImplClient* client); |
| 147 void DidLoseOutputSurface(); | 201 void DidLoseOutputSurface(); |
| 148 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } | 202 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } |
| 149 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } | 203 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } |
| 150 bool UpdateLayers(); | 204 bool UpdateLayers(); |
| 151 // Called when the compositor completed page scale animation. | 205 // Called when the compositor completed page scale animation. |
| 152 void DidCompletePageScaleAnimation(); | 206 void DidCompletePageScaleAnimation(); |
| 207 void ApplyScrollAndScale(ScrollAndScaleSet* info); |
| 153 | 208 |
| 154 LayerTreeHostClient* client() { return client_; } | 209 LayerTreeHostClient* client() { return client_; } |
| 155 const base::WeakPtr<InputHandler>& GetInputHandler() { | |
| 156 return input_handler_weak_ptr_; | |
| 157 } | |
| 158 | |
| 159 void NotifyInputThrottledUntilCommit(); | |
| 160 | |
| 161 void LayoutAndUpdateLayers(); | |
| 162 void Composite(base::TimeTicks frame_begin_time); | |
| 163 | |
| 164 void SetDeferCommits(bool defer_commits); | |
| 165 | |
| 166 int source_frame_number() const { return source_frame_number_; } | |
| 167 | 210 |
| 168 bool gpu_rasterization_histogram_recorded() const { | 211 bool gpu_rasterization_histogram_recorded() const { |
| 169 return gpu_rasterization_histogram_recorded_; | 212 return gpu_rasterization_histogram_recorded_; |
| 170 } | 213 } |
| 171 | 214 |
| 172 void CollectRenderingStats(RenderingStats* stats) const; | 215 void CollectRenderingStats(RenderingStats* stats) const; |
| 173 | 216 |
| 174 RenderingStatsInstrumentation* rendering_stats_instrumentation() const { | 217 RenderingStatsInstrumentation* rendering_stats_instrumentation() const { |
| 175 return rendering_stats_instrumentation_.get(); | 218 return rendering_stats_instrumentation_.get(); |
| 176 } | 219 } |
| 177 | 220 |
| 178 void SetNeedsAnimate(); | |
| 179 virtual void SetNeedsUpdateLayers(); | |
| 180 virtual void SetNeedsCommit(); | |
| 181 void SetNeedsRedraw(); | |
| 182 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); | |
| 183 bool CommitRequested() const; | |
| 184 bool BeginMainFrameRequested() const; | |
| 185 | |
| 186 void SetNextCommitWaitsForActivation(); | 221 void SetNextCommitWaitsForActivation(); |
| 187 | 222 |
| 188 void SetNextCommitForcesRedraw(); | |
| 189 | |
| 190 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events); | 223 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events); |
| 191 | 224 |
| 192 const LayerTreeSettings& settings() const { return settings_; } | |
| 193 | |
| 194 void SetDebugState(const LayerTreeDebugState& debug_state); | |
| 195 const LayerTreeDebugState& debug_state() const { return debug_state_; } | |
| 196 | |
| 197 bool has_gpu_rasterization_trigger() const { | 225 bool has_gpu_rasterization_trigger() const { |
| 198 return has_gpu_rasterization_trigger_; | 226 return has_gpu_rasterization_trigger_; |
| 199 } | 227 } |
| 200 void SetHasGpuRasterizationTrigger(bool has_trigger); | |
| 201 | |
| 202 void ApplyPageScaleDeltaFromImplSide(float page_scale_delta); | |
| 203 | |
| 204 void SetVisible(bool visible); | |
| 205 bool visible() const { return visible_; } | |
| 206 | |
| 207 void ApplyScrollAndScale(ScrollAndScaleSet* info); | |
| 208 | |
| 209 void UpdateTopControlsState(TopControlsState constraints, | |
| 210 TopControlsState current, | |
| 211 bool animate); | |
| 212 | 228 |
| 213 Proxy* proxy() const { return proxy_.get(); } | 229 Proxy* proxy() const { return proxy_.get(); } |
| 214 TaskRunnerProvider* task_runner_provider() const { | |
| 215 return task_runner_provider_.get(); | |
| 216 } | |
| 217 AnimationHost* animation_host() const; | |
| 218 | 230 |
| 219 // CreateUIResource creates a resource given a bitmap. The bitmap is | 231 // CreateUIResource creates a resource given a bitmap. The bitmap is |
| 220 // generated via an interface function, which is called when initializing the | 232 // generated via an interface function, which is called when initializing the |
| 221 // resource and when the resource has been lost (due to lost context). The | 233 // resource and when the resource has been lost (due to lost context). The |
| 222 // parameter of the interface is a single boolean, which indicates whether the | 234 // parameter of the interface is a single boolean, which indicates whether the |
| 223 // resource has been lost or not. CreateUIResource returns an Id of the | 235 // resource has been lost or not. CreateUIResource returns an Id of the |
| 224 // resource, which is always positive. | 236 // resource, which is always positive. |
| 225 virtual UIResourceId CreateUIResource(UIResourceClient* client); | 237 virtual UIResourceId CreateUIResource(UIResourceClient* client); |
| 226 // Deletes a UI resource. May safely be called more than once. | 238 // Deletes a UI resource. May safely be called more than once. |
| 227 virtual void DeleteUIResource(UIResourceId id); | 239 virtual void DeleteUIResource(UIResourceId id); |
| 228 // Put the recreation of all UI resources into the resource queue after they | 240 // Put the recreation of all UI resources into the resource queue after they |
| 229 // were evicted on the impl thread. | 241 // were evicted on the impl thread. |
| 230 void RecreateUIResources(); | 242 void RecreateUIResources(); |
| 231 | 243 |
| 232 virtual gfx::Size GetUIResourceSize(UIResourceId id) const; | 244 virtual gfx::Size GetUIResourceSize(UIResourceId id) const; |
| 233 | 245 |
| 234 int id() const { return id_; } | |
| 235 | |
| 236 // Returns the id of the benchmark on success, 0 otherwise. | |
| 237 int ScheduleMicroBenchmark(const std::string& benchmark_name, | |
| 238 std::unique_ptr<base::Value> value, | |
| 239 const MicroBenchmark::DoneCallback& callback); | |
| 240 // Returns true if the message was successfully delivered and handled. | |
| 241 bool SendMessageToMicroBenchmark(int id, std::unique_ptr<base::Value> value); | |
| 242 | |
| 243 // When a SwapPromiseMonitor is created on the main thread, it calls | |
| 244 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. | |
| 245 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | |
| 246 // to unregister itself. | |
| 247 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | |
| 248 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | |
| 249 | |
| 250 // Call this function when you expect there to be a swap buffer. | |
| 251 // See swap_promise.h for how to use SwapPromise. | |
| 252 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise); | |
| 253 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 246 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
| 254 std::vector<std::unique_ptr<SwapPromise>> TakeSwapPromises(); | 247 std::vector<std::unique_ptr<SwapPromise>> TakeSwapPromises(); |
| 255 | 248 |
| 256 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 249 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
| 257 | 250 |
| 258 void set_surface_client_id(uint32_t client_id); | |
| 259 SurfaceSequence CreateSurfaceSequence(); | 251 SurfaceSequence CreateSurfaceSequence(); |
| 260 | 252 |
| 261 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); | |
| 262 | |
| 263 // Serializes the parts of this LayerTreeHost that is needed for a commit to a | 253 // Serializes the parts of this LayerTreeHost that is needed for a commit to a |
| 264 // protobuf message. Not all members are serialized as they are not helpful | 254 // protobuf message. Not all members are serialized as they are not helpful |
| 265 // for remote usage. | 255 // for remote usage. |
| 266 // The |swap_promise_list_| is transferred to the serializer in | 256 // The |swap_promise_list_| is transferred to the serializer in |
| 267 // |swap_promises|. | 257 // |swap_promises|. |
| 268 void ToProtobufForCommit( | 258 void ToProtobufForCommit( |
| 269 proto::LayerTreeHost* proto, | 259 proto::LayerTreeHost* proto, |
| 270 std::vector<std::unique_ptr<SwapPromise>>* swap_promises); | 260 std::vector<std::unique_ptr<SwapPromise>>* swap_promises); |
| 271 | 261 |
| 272 // Deserializes the protobuf into this LayerTreeHost before a commit. The | 262 // Deserializes the protobuf into this LayerTreeHost before a commit. The |
| (...skipping 12 matching lines...) Expand all Loading... |
| 285 } | 275 } |
| 286 | 276 |
| 287 EnginePictureCache* engine_picture_cache() const { | 277 EnginePictureCache* engine_picture_cache() const { |
| 288 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; | 278 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; |
| 289 } | 279 } |
| 290 | 280 |
| 291 ClientPictureCache* client_picture_cache() const { | 281 ClientPictureCache* client_picture_cache() const { |
| 292 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; | 282 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; |
| 293 } | 283 } |
| 294 | 284 |
| 295 LayerTree* GetLayerTree() { return layer_tree_.get(); } | |
| 296 const LayerTree* GetLayerTree() const { return layer_tree_.get(); } | |
| 297 | |
| 298 void ResetGpuRasterizationTracking(); | 285 void ResetGpuRasterizationTracking(); |
| 299 | 286 |
| 300 protected: | 287 protected: |
| 301 // Allow tests to inject the LayerTree. | 288 // Allow tests to inject the LayerTree. |
| 302 LayerTreeHost(InitParams* params, | 289 LayerTreeHost(InitParams* params, |
| 303 CompositorMode mode, | 290 CompositorMode mode, |
| 304 std::unique_ptr<LayerTree> layer_tree); | 291 std::unique_ptr<LayerTree> layer_tree); |
| 305 LayerTreeHost(InitParams* params, CompositorMode mode); | 292 LayerTreeHost(InitParams* params, CompositorMode mode); |
| 306 | 293 |
| 307 void InitializeThreaded( | 294 void InitializeThreaded( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 base::WeakPtr<InputHandler> input_handler_weak_ptr_; | 336 base::WeakPtr<InputHandler> input_handler_weak_ptr_; |
| 350 | 337 |
| 351 private: | 338 private: |
| 352 friend class LayerTreeHostSerializationTest; | 339 friend class LayerTreeHostSerializationTest; |
| 353 | 340 |
| 354 // This is the number of consecutive frames in which we want the content to be | 341 // This is the number of consecutive frames in which we want the content to be |
| 355 // suitable for GPU rasterization before re-enabling it. | 342 // suitable for GPU rasterization before re-enabling it. |
| 356 enum { kNumFramesToConsiderBeforeGpuRasterization = 60 }; | 343 enum { kNumFramesToConsiderBeforeGpuRasterization = 60 }; |
| 357 | 344 |
| 358 void ApplyViewportDeltas(ScrollAndScaleSet* info); | 345 void ApplyViewportDeltas(ScrollAndScaleSet* info); |
| 346 void ApplyPageScaleDeltaFromImplSide(float page_scale_delta); |
| 359 void InitializeProxy( | 347 void InitializeProxy( |
| 360 std::unique_ptr<Proxy> proxy, | 348 std::unique_ptr<Proxy> proxy, |
| 361 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 349 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
| 362 | 350 |
| 363 bool DoUpdateLayers(Layer* root_layer); | 351 bool DoUpdateLayers(Layer* root_layer); |
| 364 void UpdateHudLayer(); | 352 void UpdateHudLayer(); |
| 365 | 353 |
| 366 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 354 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
| 367 | 355 |
| 368 struct UIResourceClientData { | 356 struct UIResourceClientData { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 uint32_t surface_client_id_; | 420 uint32_t surface_client_id_; |
| 433 uint32_t next_surface_sequence_; | 421 uint32_t next_surface_sequence_; |
| 434 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; | 422 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; |
| 435 | 423 |
| 436 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 424 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 437 }; | 425 }; |
| 438 | 426 |
| 439 } // namespace cc | 427 } // namespace cc |
| 440 | 428 |
| 441 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 429 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |