| 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_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 "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/base/completion_event.h" |
| 10 #include "cc/input/top_controls_state.h" | 11 #include "cc/input/top_controls_state.h" |
| 12 #include "cc/output/output_surface.h" |
| 13 #include "cc/scheduler/commit_earlyout_reason.h" |
| 14 #include "cc/trees/proxy_common.h" |
| 11 | 15 |
| 12 namespace cc { | 16 namespace cc { |
| 13 | |
| 14 // TODO(khushalsagar): The impl side of ThreadProxy. It is currently defined as | 17 // TODO(khushalsagar): The impl side of ThreadProxy. It is currently defined as |
| 15 // an interface with the implementation provided by ThreadProxy and will be | 18 // an interface with the implementation provided by ThreadProxy and will be |
| 16 // made an independent class. | 19 // made an independent class. |
| 17 // The methods added to this interface should only use the CompositorThreadOnly | 20 // The methods added to this interface should only use the CompositorThreadOnly |
| 18 // variables from ThreadProxy. | 21 // variables from ThreadProxy. |
| 19 // See crbug/527200 | 22 // See crbug/527200 |
| 20 class CC_EXPORT ProxyImpl { | 23 class CC_EXPORT ProxyImpl { |
| 21 public: | 24 public: |
| 22 // Callback for impl side commands received from the channel. | 25 // Callback for impl side commands received from the channel. |
| 23 virtual void SetThrottleFrameProductionOnImpl(bool throttle) = 0; | 26 virtual void SetThrottleFrameProductionOnImpl(bool throttle) = 0; |
| 24 virtual void UpdateTopControlsStateOnImpl(TopControlsState constraints, | 27 virtual void UpdateTopControlsStateOnImpl(TopControlsState constraints, |
| 25 TopControlsState current, | 28 TopControlsState current, |
| 26 bool animate) = 0; | 29 bool animate) = 0; |
| 30 virtual void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) = 0; |
| 31 virtual void MainThreadHasStoppedFlingingOnImpl() = 0; |
| 32 virtual void SetInputThrottledUntilCommitOnImpl(bool is_throttled) = 0; |
| 33 virtual void SetDeferCommitsOnImpl(bool defer_commits) = 0; |
| 34 virtual void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) = 0; |
| 35 virtual void SetNeedsCommitOnImpl() = 0; |
| 36 virtual void BeginMainFrameAbortedOnImpl(CommitEarlyOutReason reason) = 0; |
| 37 virtual void FinishAllRenderingOnImpl(CompletionEvent* completion) = 0; |
| 38 virtual void SetVisibleOnImpl(CompletionEvent* completion, bool visible) = 0; |
| 39 virtual void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) = 0; |
| 40 virtual void FinishGLOnImpl(CompletionEvent* completion) = 0; |
| 41 virtual void MainFrameWillHappenOnImplForTesting( |
| 42 CompletionEvent* completion, |
| 43 bool* main_frame_will_happen) = 0; |
| 44 virtual void StartCommitOnImpl( |
| 45 CompletionEvent* completion, |
| 46 BlockedMainCommitState* blocked_main_commit_state) = 0; |
| 27 | 47 |
| 28 // TODO(khushalsagar): Rename as GetWeakPtr() once ThreadProxy is split. | 48 // TODO(khushalsagar): Rename as GetWeakPtr() once ThreadProxy is split. |
| 29 virtual base::WeakPtr<ProxyImpl> GetImplWeakPtr() = 0; | 49 virtual base::WeakPtr<ProxyImpl> GetImplWeakPtr() = 0; |
| 30 | 50 |
| 31 protected: | 51 protected: |
| 32 virtual ~ProxyImpl() {} | 52 virtual ~ProxyImpl() {} |
| 33 }; | 53 }; |
| 34 | 54 |
| 35 } // namespace cc | 55 } // namespace cc |
| 36 | 56 |
| 37 #endif // CC_TREES_PROXY_IMPL_H_ | 57 #endif // CC_TREES_PROXY_IMPL_H_ |
| OLD | NEW |