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