| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
| 6 #define CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 6 #define CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // For successful swaps, the implementation must call DidSwapBuffersComplete() | 111 // For successful swaps, the implementation must call DidSwapBuffersComplete() |
| 112 // (via OnSwapBuffersComplete()) eventually. | 112 // (via OnSwapBuffersComplete()) eventually. |
| 113 virtual void SwapBuffers(CompositorFrame frame) = 0; | 113 virtual void SwapBuffers(CompositorFrame frame) = 0; |
| 114 virtual void OnSwapBuffersComplete(); | 114 virtual void OnSwapBuffersComplete(); |
| 115 | 115 |
| 116 // base::trace_event::MemoryDumpProvider implementation. | 116 // base::trace_event::MemoryDumpProvider implementation. |
| 117 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 117 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 118 base::trace_event::ProcessMemoryDump* pmd) override; | 118 base::trace_event::ProcessMemoryDump* pmd) override; |
| 119 | 119 |
| 120 protected: | 120 protected: |
| 121 // This is used by both display and delegating implementations. | |
| 122 void PostSwapBuffersComplete(); | |
| 123 | |
| 124 // Bound to the ContextProvider to hear about when it is lost and inform the | 121 // Bound to the ContextProvider to hear about when it is lost and inform the |
| 125 // |client_|. | 122 // |client_|. |
| 126 void DidLoseCompositorFrameSink(); | 123 void DidLoseCompositorFrameSink(); |
| 127 | 124 |
| 128 CompositorFrameSinkClient* client_ = nullptr; | 125 CompositorFrameSinkClient* client_ = nullptr; |
| 129 | 126 |
| 130 struct CompositorFrameSink::Capabilities capabilities_; | 127 struct CompositorFrameSink::Capabilities capabilities_; |
| 131 scoped_refptr<ContextProvider> context_provider_; | 128 scoped_refptr<ContextProvider> context_provider_; |
| 132 scoped_refptr<ContextProvider> worker_context_provider_; | 129 scoped_refptr<ContextProvider> worker_context_provider_; |
| 133 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 130 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
| 134 base::ThreadChecker client_thread_checker_; | 131 base::ThreadChecker client_thread_checker_; |
| 135 | 132 |
| 136 private: | 133 private: |
| 137 void DetachFromClientInternal(); | 134 void DetachFromClientInternal(); |
| 138 | 135 |
| 139 base::WeakPtrFactory<CompositorFrameSink> weak_ptr_factory_; | 136 base::WeakPtrFactory<CompositorFrameSink> weak_ptr_factory_; |
| 140 | 137 |
| 141 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); | 138 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); |
| 142 }; | 139 }; |
| 143 | 140 |
| 144 } // namespace cc | 141 } // namespace cc |
| 145 | 142 |
| 146 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 143 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |