Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: cc/trees/proxy_impl.h

Issue 2000493002: cc: Fix overwriting of commit completion event in MFBA mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_IMPL_H_ 5 #ifndef CC_TREES_PROXY_IMPL_H_
6 #define CC_TREES_PROXY_IMPL_H_ 6 #define CC_TREES_PROXY_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 30 matching lines...) Expand all
41 virtual void SetDeferCommitsOnImpl(bool defer_commits) const; 41 virtual void SetDeferCommitsOnImpl(bool defer_commits) const;
42 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect); 42 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect);
43 virtual void SetNeedsCommitOnImpl(); 43 virtual void SetNeedsCommitOnImpl();
44 virtual void BeginMainFrameAbortedOnImpl( 44 virtual void BeginMainFrameAbortedOnImpl(
45 CommitEarlyOutReason reason, 45 CommitEarlyOutReason reason,
46 base::TimeTicks main_thread_start_time); 46 base::TimeTicks main_thread_start_time);
47 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion); 47 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion);
48 virtual void SetVisibleOnImpl(bool visible); 48 virtual void SetVisibleOnImpl(bool visible);
49 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion); 49 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion);
50 virtual void FinishGLOnImpl(CompletionEvent* completion); 50 virtual void FinishGLOnImpl(CompletionEvent* completion);
51 virtual void MainFrameWillHappenOnImplForTesting(
52 CompletionEvent* completion,
53 bool* main_frame_will_happen);
54 virtual void StartCommitOnImpl(CompletionEvent* completion, 51 virtual void StartCommitOnImpl(CompletionEvent* completion,
55 LayerTreeHost* layer_tree_host, 52 LayerTreeHost* layer_tree_host,
56 base::TimeTicks main_thread_start_time, 53 base::TimeTicks main_thread_start_time,
57 bool hold_commit_for_activation); 54 bool hold_commit_for_activation);
58 55
56 void MainFrameWillHappenOnImplForTesting(CompletionEvent* completion,
57 bool* main_frame_will_happen);
58 void BlockNotifyReadyToActivateForTesting(bool block);
59
59 protected: 60 protected:
60 // protected for testing. 61 // protected for testing.
61 ProxyImpl(ChannelImpl* channel_impl, 62 ProxyImpl(ChannelImpl* channel_impl,
62 LayerTreeHost* layer_tree_host, 63 LayerTreeHost* layer_tree_host,
63 TaskRunnerProvider* task_runner_provider, 64 TaskRunnerProvider* task_runner_provider,
64 std::unique_ptr<BeginFrameSource> external_begin_frame_source); 65 std::unique_ptr<BeginFrameSource> external_begin_frame_source);
65 66
66 private: 67 private:
67 // The members of this struct should be accessed on the impl thread only when 68 // The members of this struct should be accessed on the impl thread only when
68 // the main thread is blocked for a commit. 69 // the main thread is blocked for a commit.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 DrawResult DrawAndSwapInternal(bool forced_draw); 124 DrawResult DrawAndSwapInternal(bool forced_draw);
124 125
125 bool IsImplThread() const; 126 bool IsImplThread() const;
126 bool IsMainThreadBlocked() const; 127 bool IsMainThreadBlocked() const;
127 128
128 const int layer_tree_host_id_; 129 const int layer_tree_host_id_;
129 130
130 std::unique_ptr<Scheduler> scheduler_; 131 std::unique_ptr<Scheduler> scheduler_;
131 132
132 // Set when the main thread is waiting on a pending tree activation. 133 // Set when the main thread is waiting on a pending tree activation.
133 bool next_commit_waits_for_activation_; 134 bool commit_completion_waits_for_activation_;
134 135
135 // Set when the main thread is waiting on a commit to complete or on a 136 // Set when the main thread is waiting on a commit to complete.
136 // pending tree activation.
137 CompletionEvent* commit_completion_event_; 137 CompletionEvent* commit_completion_event_;
138 138
139 // Set when the main thread is waiting for activation to complete.
140 CompletionEvent* activation_completion_event_;
141
139 // Set when the next draw should post DidCommitAndDrawFrame to the main 142 // Set when the next draw should post DidCommitAndDrawFrame to the main
140 // thread. 143 // thread.
141 bool next_frame_is_newly_committed_frame_; 144 bool next_frame_is_newly_committed_frame_;
142 145
143 bool inside_draw_; 146 bool inside_draw_;
144 bool input_throttled_until_commit_; 147 bool input_throttled_until_commit_;
145 148
146 TaskRunnerProvider* task_runner_provider_; 149 TaskRunnerProvider* task_runner_provider_;
147 150
148 DelayedUniqueNotifier smoothness_priority_expiration_notifier_; 151 DelayedUniqueNotifier smoothness_priority_expiration_notifier_;
(...skipping 11 matching lines...) Expand all
160 // Use accessors instead of this variable directly. 163 // Use accessors instead of this variable directly.
161 BlockedMainCommitOnly main_thread_blocked_commit_vars_unsafe_; 164 BlockedMainCommitOnly main_thread_blocked_commit_vars_unsafe_;
162 BlockedMainCommitOnly& blocked_main_commit(); 165 BlockedMainCommitOnly& blocked_main_commit();
163 166
164 DISALLOW_COPY_AND_ASSIGN(ProxyImpl); 167 DISALLOW_COPY_AND_ASSIGN(ProxyImpl);
165 }; 168 };
166 169
167 } // namespace cc 170 } // namespace cc
168 171
169 #endif // CC_TREES_PROXY_IMPL_H_ 172 #endif // CC_TREES_PROXY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698