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

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

Issue 1377063003: Split ThreadProxy methods to ProxyMain and ProxyImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments. Created 5 years, 2 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
« no previous file with comments | « cc/trees/proxy_main.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_THREAD_PROXY_H_ 5 #ifndef CC_TREES_THREAD_PROXY_H_
6 #define CC_TREES_THREAD_PROXY_H_ 6 #define CC_TREES_THREAD_PROXY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 void ScheduledActionBeginOutputSurfaceCreation() override; 243 void ScheduledActionBeginOutputSurfaceCreation() override;
244 void ScheduledActionPrepareTiles() override; 244 void ScheduledActionPrepareTiles() override;
245 void ScheduledActionInvalidateOutputSurface() override; 245 void ScheduledActionInvalidateOutputSurface() override;
246 void SendBeginFramesToChildren(const BeginFrameArgs& args) override; 246 void SendBeginFramesToChildren(const BeginFrameArgs& args) override;
247 void SendBeginMainFrameNotExpectedSoon() override; 247 void SendBeginMainFrameNotExpectedSoon() override;
248 248
249 // ProxyMain implementation 249 // ProxyMain implementation
250 base::WeakPtr<ProxyMain> GetMainWeakPtr() override; 250 base::WeakPtr<ProxyMain> GetMainWeakPtr() override;
251 void SetChannel(scoped_ptr<ThreadedChannel> threaded_channel) override; 251 void SetChannel(scoped_ptr<ThreadedChannel> threaded_channel) override;
252 void DidCompleteSwapBuffers() override; 252 void DidCompleteSwapBuffers() override;
253 void SetRendererCapabilitiesMainCopy(
254 const RendererCapabilities& capabilities) override;
255 void BeginMainFrameNotExpectedSoon() override;
256 void DidCommitAndDrawFrame() override;
257 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue) override;
258 void DidLoseOutputSurface() override;
259 void RequestNewOutputSurface() override;
260 void DidInitializeOutputSurface(
khushalsagar 2015/10/01 21:19:37 The output surface creation and release will be ha
danakj 2015/10/08 18:03:32 I think we can get rid of the output surface point
261 bool success,
262 const RendererCapabilities& capabilities) override;
263 void DidCompletePageScaleAnimation() override;
264 void PostFrameTimingEventsOnMain(
265 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
266 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events)
267 override;
253 268
254 // ProxyImpl implementation 269 // ProxyImpl implementation
255 base::WeakPtr<ProxyImpl> GetImplWeakPtr() override; 270 base::WeakPtr<ProxyImpl> GetImplWeakPtr() override;
256 void SetThrottleFrameProductionOnImpl(bool throttle) override; 271 void SetThrottleFrameProductionOnImpl(bool throttle) override;
257 void SetLayerTreeHostClientReadyOnImpl() override; 272 void SetLayerTreeHostClientReadyOnImpl() override;
273 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override;
274 void MainThreadHasStoppedFlingingOnImpl() override;
275 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override;
276 void SetDeferCommitsOnImpl(bool defer_commits) override;
277 void FinishAllRenderingOnImpl() override;
278 void SetVisibleOnImpl(bool visible) override;
khushalsagar 2015/10/01 21:19:37 This is caused by SetVisible sent to LTH which set
279 void ReleaseOutputSurfaceOnImpl() override;
280 void FinishGLOnImpl() override;
281 void MainFrameWillHappenOnImplForTesting(
282 bool* main_frame_will_happen) override;
258 283
259 protected: 284 protected:
260 ThreadProxy( 285 ThreadProxy(
261 LayerTreeHost* layer_tree_host, 286 LayerTreeHost* layer_tree_host,
262 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 287 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
263 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 288 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
264 scoped_ptr<BeginFrameSource> external_begin_frame_source); 289 scoped_ptr<BeginFrameSource> external_begin_frame_source);
265 290
266 private: 291 private:
267 // Called on main thread. 292 // Called on main thread.
268 void SetRendererCapabilitiesMainThreadCopy(
269 const RendererCapabilities& capabilities);
270 void BeginMainFrame( 293 void BeginMainFrame(
271 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state); 294 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state);
272 void BeginMainFrameNotExpectedSoon();
273 void DidCommitAndDrawFrame();
274 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue);
275 void DidLoseOutputSurface();
276 void RequestNewOutputSurface();
277 void DidInitializeOutputSurface(bool success,
278 const RendererCapabilities& capabilities);
279 // Returns |true| if the request was actually sent, |false| if one was 295 // Returns |true| if the request was actually sent, |false| if one was
280 // already outstanding. 296 // already outstanding.
281 bool SendCommitRequestToImplThreadIfNeeded( 297 bool SendCommitRequestToImplThreadIfNeeded(
282 CommitPipelineStage required_stage); 298 CommitPipelineStage required_stage);
283 void DidCompletePageScaleAnimation();
284 299
285 // Called on impl thread. 300 // Called on impl thread.
286 struct SchedulerStateRequest; 301 struct SchedulerStateRequest;
287 302
288 void StartCommitOnImplThread(CompletionEvent* completion); 303 void StartCommitOnImplThread(CompletionEvent* completion);
289 void BeginMainFrameAbortedOnImplThread(CommitEarlyOutReason reason); 304 void BeginMainFrameAbortedOnImplThread(CommitEarlyOutReason reason);
290 void FinishAllRenderingOnImplThread(CompletionEvent* completion);
291 void InitializeImplOnImplThread(CompletionEvent* completion); 305 void InitializeImplOnImplThread(CompletionEvent* completion);
292 void SetVisibleOnImplThread(CompletionEvent* completion, bool visible);
293 void HasInitializedOutputSurfaceOnImplThread(
294 CompletionEvent* completion,
295 bool* has_initialized_output_surface);
296 void DeleteContentsTexturesOnImplThread(CompletionEvent* completion);
297 void InitializeOutputSurfaceOnImplThread(OutputSurface* output_surface);
298 void ReleaseOutputSurfaceOnImplThread(CompletionEvent* completion);
299 void FinishGLOnImplThread(CompletionEvent* completion);
300 void LayerTreeHostClosedOnImplThread(CompletionEvent* completion); 306 void LayerTreeHostClosedOnImplThread(CompletionEvent* completion);
301 DrawResult DrawSwapInternal(bool forced_draw); 307 DrawResult DrawSwapInternal(bool forced_draw);
302 void MainFrameWillHappenOnImplThreadForTesting(CompletionEvent* completion,
303 bool* main_frame_will_happen);
304 void SetSwapUsedIncompleteTileOnImplThread(bool used_incomplete_tile);
305 void MainThreadHasStoppedFlingingOnImplThread();
306 void SetInputThrottledUntilCommitOnImplThread(bool is_throttled);
307 void SetDeferCommitsOnImplThread(bool defer_commits) const;
308 void PostFrameTimingEvents(
309 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
310 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events);
311 308
312 LayerTreeHost* layer_tree_host(); 309 LayerTreeHost* layer_tree_host();
313 const LayerTreeHost* layer_tree_host() const; 310 const LayerTreeHost* layer_tree_host() const;
314 311
315 // Use accessors instead of this variable directly. 312 // Use accessors instead of this variable directly.
316 MainThreadOnly main_thread_only_vars_unsafe_; 313 MainThreadOnly main_thread_only_vars_unsafe_;
317 MainThreadOnly& main(); 314 MainThreadOnly& main();
318 315
319 // Use accessors instead of this variable directly. 316 // Use accessors instead of this variable directly.
320 MainThreadOrBlockedMainThread main_thread_or_blocked_vars_unsafe_; 317 MainThreadOrBlockedMainThread main_thread_or_blocked_vars_unsafe_;
321 MainThreadOrBlockedMainThread& blocked_main(); 318 MainThreadOrBlockedMainThread& blocked_main();
322 319
323 // Use accessors instead of this variable directly. 320 // Use accessors instead of this variable directly.
324 CompositorThreadOnly compositor_thread_vars_unsafe_; 321 CompositorThreadOnly compositor_thread_vars_unsafe_;
325 CompositorThreadOnly& impl(); 322 CompositorThreadOnly& impl();
326 323
327 // TODO(khushalsagar): Remove this. Temporary variable to hold the channel. 324 // TODO(khushalsagar): Remove this. Temporary variable to hold the channel.
328 scoped_ptr<ThreadedChannel> threaded_channel_; 325 scoped_ptr<ThreadedChannel> threaded_channel_;
329 326
330 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_; 327 base::WeakPtr<ThreadProxy> main_thread_weak_ptr_;
331 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_; 328 base::WeakPtr<ThreadProxy> impl_thread_weak_ptr_;
332 329
333 DISALLOW_COPY_AND_ASSIGN(ThreadProxy); 330 DISALLOW_COPY_AND_ASSIGN(ThreadProxy);
334 }; 331 };
335 332
336 } // namespace cc 333 } // namespace cc
337 334
338 #endif // CC_TREES_THREAD_PROXY_H_ 335 #endif // CC_TREES_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « cc/trees/proxy_main.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698