| 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/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/animation/animation_events.h" |
| 9 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 #include "cc/debug/frame_timing_tracker.h" |
| 12 #include "cc/output/renderer_capabilities.h" |
| 10 | 13 |
| 11 namespace cc { | 14 namespace cc { |
| 12 class ThreadedChannel; | 15 class ThreadedChannel; |
| 13 | 16 |
| 14 // TODO(khushalsagar): The main side of ThreadProxy. It is currently defined as | 17 // TODO(khushalsagar): The main 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 MainThreadOnly or | 20 // The methods added to this interface should only use the MainThreadOnly or |
| 18 // BlockedMainThread variables from ThreadProxy. | 21 // BlockedMainThread variables from ThreadProxy. |
| 19 // See crbug/527200. | 22 // See crbug/527200. |
| 20 class CC_EXPORT ProxyMain { | 23 class CC_EXPORT ProxyMain { |
| 21 public: | 24 public: |
| 22 // TODO(khushalsagar): Make this ChannelMain*. When ProxyMain and | 25 // TODO(khushalsagar): Make this ChannelMain*. When ProxyMain and |
| 23 // ProxyImpl are split, ProxyImpl will be passed a reference to ChannelImpl | 26 // ProxyImpl are split, ProxyImpl will be passed a reference to ChannelImpl |
| 24 // at creation. Right now we just set it directly from ThreadedChannel | 27 // at creation. Right now we just set it directly from ThreadedChannel |
| 25 // when the impl side is initialized. | 28 // when the impl side is initialized. |
| 26 virtual void SetChannel(scoped_ptr<ThreadedChannel> threaded_channel) = 0; | 29 virtual void SetChannel(scoped_ptr<ThreadedChannel> threaded_channel) = 0; |
| 27 | 30 |
| 28 // Callback for main side commands received from the Channel. | 31 // Callback for main side commands received from the Channel. |
| 29 virtual void DidCompleteSwapBuffers() = 0; | 32 virtual void DidCompleteSwapBuffers() = 0; |
| 33 virtual void SetRendererCapabilitiesMainCopy( |
| 34 const RendererCapabilities& capabilities) = 0; |
| 35 virtual void BeginMainFrameNotExpectedSoon() = 0; |
| 36 virtual void DidCommitAndDrawFrame() = 0; |
| 37 virtual void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue) = 0; |
| 38 virtual void DidLoseOutputSurface() = 0; |
| 39 virtual void RequestNewOutputSurface() = 0; |
| 40 virtual void DidInitializeOutputSurface( |
| 41 bool success, |
| 42 const RendererCapabilities& capabilities) = 0; |
| 43 virtual void DidCompletePageScaleAnimation() = 0; |
| 44 virtual void PostFrameTimingEventsOnMain( |
| 45 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 46 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) = 0; |
| 30 | 47 |
| 31 // TODO(khushalsagar): Rename as GetWeakPtr() once ThreadProxy is split. | 48 // TODO(khushalsagar): Rename as GetWeakPtr() once ThreadProxy is split. |
| 32 virtual base::WeakPtr<ProxyMain> GetMainWeakPtr() = 0; | 49 virtual base::WeakPtr<ProxyMain> GetMainWeakPtr() = 0; |
| 33 | 50 |
| 34 protected: | 51 protected: |
| 35 virtual ~ProxyMain() {} | 52 virtual ~ProxyMain() {} |
| 36 }; | 53 }; |
| 37 | 54 |
| 38 } // namespace cc | 55 } // namespace cc |
| 39 | 56 |
| 40 #endif // CC_TREES_PROXY_MAIN_H_ | 57 #endif // CC_TREES_PROXY_MAIN_H_ |
| OLD | NEW |