| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROXY_MAIN_H_ | 5 #ifndef CC_TREES_PROXY_MAIN_H_ |
| 6 #define CC_TREES_PROXY_MAIN_H_ | 6 #define CC_TREES_PROXY_MAIN_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/input/top_controls_state.h" | 10 #include "cc/input/top_controls_state.h" |
| 11 #include "cc/output/output_surface.h" | 11 #include "cc/output/output_surface.h" |
| 12 #include "cc/output/renderer_capabilities.h" | |
| 13 #include "cc/trees/channel_main.h" | 12 #include "cc/trees/channel_main.h" |
| 14 #include "cc/trees/proxy.h" | 13 #include "cc/trees/proxy.h" |
| 15 #include "cc/trees/proxy_common.h" | 14 #include "cc/trees/proxy_common.h" |
| 16 #include "cc/trees/remote_proto_channel.h" | 15 #include "cc/trees/remote_proto_channel.h" |
| 17 | 16 |
| 18 namespace cc { | 17 namespace cc { |
| 19 | 18 |
| 20 class AnimationEvents; | 19 class AnimationEvents; |
| 21 class BeginFrameSource; | 20 class BeginFrameSource; |
| 22 class ChannelMain; | 21 class ChannelMain; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 // with the following stages. For efficiency we can early out at any stage if | 42 // with the following stages. For efficiency we can early out at any stage if |
| 44 // we decide that no further processing is necessary. | 43 // we decide that no further processing is necessary. |
| 45 enum CommitPipelineStage { | 44 enum CommitPipelineStage { |
| 46 NO_PIPELINE_STAGE, | 45 NO_PIPELINE_STAGE, |
| 47 ANIMATE_PIPELINE_STAGE, | 46 ANIMATE_PIPELINE_STAGE, |
| 48 UPDATE_LAYERS_PIPELINE_STAGE, | 47 UPDATE_LAYERS_PIPELINE_STAGE, |
| 49 COMMIT_PIPELINE_STAGE, | 48 COMMIT_PIPELINE_STAGE, |
| 50 }; | 49 }; |
| 51 | 50 |
| 52 void DidCompleteSwapBuffers(); | 51 void DidCompleteSwapBuffers(); |
| 53 void SetRendererCapabilities(const RendererCapabilities& capabilities); | |
| 54 void BeginMainFrameNotExpectedSoon(); | 52 void BeginMainFrameNotExpectedSoon(); |
| 55 void DidCommitAndDrawFrame(); | 53 void DidCommitAndDrawFrame(); |
| 56 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events); | 54 void SetAnimationEvents(std::unique_ptr<AnimationEvents> events); |
| 57 void DidLoseOutputSurface(); | 55 void DidLoseOutputSurface(); |
| 58 void RequestNewOutputSurface(); | 56 void RequestNewOutputSurface(); |
| 59 void DidInitializeOutputSurface(bool success, | 57 void DidInitializeOutputSurface(bool success); |
| 60 const RendererCapabilities& capabilities); | |
| 61 void DidCompletePageScaleAnimation(); | 58 void DidCompletePageScaleAnimation(); |
| 62 void BeginMainFrame( | 59 void BeginMainFrame( |
| 63 std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); | 60 std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); |
| 64 | 61 |
| 65 ChannelMain* channel_main() const { return channel_main_.get(); } | 62 ChannelMain* channel_main() const { return channel_main_.get(); } |
| 66 CommitPipelineStage max_requested_pipeline_stage() const { | 63 CommitPipelineStage max_requested_pipeline_stage() const { |
| 67 return max_requested_pipeline_stage_; | 64 return max_requested_pipeline_stage_; |
| 68 } | 65 } |
| 69 CommitPipelineStage current_pipeline_stage() const { | 66 CommitPipelineStage current_pipeline_stage() const { |
| 70 return current_pipeline_stage_; | 67 return current_pipeline_stage_; |
| 71 } | 68 } |
| 72 CommitPipelineStage final_pipeline_stage() const { | 69 CommitPipelineStage final_pipeline_stage() const { |
| 73 return final_pipeline_stage_; | 70 return final_pipeline_stage_; |
| 74 } | 71 } |
| 75 | 72 |
| 76 protected: | 73 protected: |
| 77 ProxyMain(LayerTreeHost* layer_tree_host, | 74 ProxyMain(LayerTreeHost* layer_tree_host, |
| 78 TaskRunnerProvider* task_runner_provider); | 75 TaskRunnerProvider* task_runner_provider); |
| 79 | 76 |
| 80 private: | 77 private: |
| 81 friend class ProxyMainForTest; | 78 friend class ProxyMainForTest; |
| 82 | 79 |
| 83 // Proxy implementation. | 80 // Proxy implementation. |
| 84 bool IsStarted() const override; | 81 bool IsStarted() const override; |
| 85 bool CommitToActiveTree() const override; | 82 bool CommitToActiveTree() const override; |
| 86 void SetOutputSurface(OutputSurface* output_surface) override; | 83 void SetOutputSurface(OutputSurface* output_surface) override; |
| 87 void SetVisible(bool visible) override; | 84 void SetVisible(bool visible) override; |
| 88 const RendererCapabilities& GetRendererCapabilities() const override; | |
| 89 void SetNeedsAnimate() override; | 85 void SetNeedsAnimate() override; |
| 90 void SetNeedsUpdateLayers() override; | 86 void SetNeedsUpdateLayers() override; |
| 91 void SetNeedsCommit() override; | 87 void SetNeedsCommit() override; |
| 92 void SetNeedsRedraw(const gfx::Rect& damage_rect) override; | 88 void SetNeedsRedraw(const gfx::Rect& damage_rect) override; |
| 93 void SetNextCommitWaitsForActivation() override; | 89 void SetNextCommitWaitsForActivation() override; |
| 94 void NotifyInputThrottledUntilCommit() override; | 90 void NotifyInputThrottledUntilCommit() override; |
| 95 void SetDeferCommits(bool defer_commits) override; | 91 void SetDeferCommits(bool defer_commits) override; |
| 96 bool CommitRequested() const override; | 92 bool CommitRequested() const override; |
| 97 bool BeginMainFrameRequested() const override; | 93 bool BeginMainFrameRequested() const override; |
| 98 void MainThreadHasStoppedFlinging() override; | 94 void MainThreadHasStoppedFlinging() override; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 CommitPipelineStage final_pipeline_stage_; | 129 CommitPipelineStage final_pipeline_stage_; |
| 134 | 130 |
| 135 bool commit_waits_for_activation_; | 131 bool commit_waits_for_activation_; |
| 136 | 132 |
| 137 // Set when the Proxy is started using Proxy::Start() and reset when it is | 133 // Set when the Proxy is started using Proxy::Start() and reset when it is |
| 138 // stopped using Proxy::Stop(). | 134 // stopped using Proxy::Stop(). |
| 139 bool started_; | 135 bool started_; |
| 140 | 136 |
| 141 bool defer_commits_; | 137 bool defer_commits_; |
| 142 | 138 |
| 143 RendererCapabilities renderer_capabilities_; | |
| 144 | |
| 145 std::unique_ptr<ChannelMain> channel_main_; | 139 std::unique_ptr<ChannelMain> channel_main_; |
| 146 | 140 |
| 147 DISALLOW_COPY_AND_ASSIGN(ProxyMain); | 141 DISALLOW_COPY_AND_ASSIGN(ProxyMain); |
| 148 }; | 142 }; |
| 149 | 143 |
| 150 } // namespace cc | 144 } // namespace cc |
| 151 | 145 |
| 152 #endif // CC_TREES_PROXY_MAIN_H_ | 146 #endif // CC_TREES_PROXY_MAIN_H_ |
| OLD | NEW |