| 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_OUTPUT_SURFACE_H_ | 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_ |
| 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ | 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // passed in (though it will not take ownership of the CompositorFrame | 131 // passed in (though it will not take ownership of the CompositorFrame |
| 132 // itself). For successful swaps, the implementation must call | 132 // itself). For successful swaps, the implementation must call |
| 133 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. | 133 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. |
| 134 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; | 134 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; |
| 135 | 135 |
| 136 // base::trace_event::MemoryDumpProvider implementation. | 136 // base::trace_event::MemoryDumpProvider implementation. |
| 137 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 137 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 138 base::trace_event::ProcessMemoryDump* pmd) override; | 138 base::trace_event::ProcessMemoryDump* pmd) override; |
| 139 | 139 |
| 140 protected: | 140 protected: |
| 141 void PostSwapBuffersComplete(); | |
| 142 | |
| 143 // Used internally for the context provider to inform the client about loss, | 141 // Used internally for the context provider to inform the client about loss, |
| 144 // and can be overridden to change behaviour instead of informing the client. | 142 // and can be overridden to change behaviour instead of informing the client. |
| 145 virtual void DidLoseOutputSurface(); | 143 virtual void DidLoseOutputSurface(); |
| 146 | 144 |
| 147 OutputSurfaceClient* client_ = nullptr; | 145 OutputSurfaceClient* client_ = nullptr; |
| 148 | 146 |
| 149 struct OutputSurface::Capabilities capabilities_; | 147 struct OutputSurface::Capabilities capabilities_; |
| 150 scoped_refptr<ContextProvider> context_provider_; | 148 scoped_refptr<ContextProvider> context_provider_; |
| 151 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 149 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
| 152 std::unique_ptr<SoftwareOutputDevice> software_device_; | 150 std::unique_ptr<SoftwareOutputDevice> software_device_; |
| 153 gfx::Size surface_size_; | 151 gfx::Size surface_size_; |
| 154 float device_scale_factor_ = -1; | 152 float device_scale_factor_ = -1; |
| 155 gfx::ColorSpace device_color_space_; | 153 gfx::ColorSpace device_color_space_; |
| 156 bool has_alpha_ = true; | 154 bool has_alpha_ = true; |
| 157 gfx::ColorSpace color_space_; | 155 gfx::ColorSpace color_space_; |
| 158 base::ThreadChecker thread_checker_; | 156 base::ThreadChecker thread_checker_; |
| 159 | 157 |
| 160 private: | 158 private: |
| 161 void OnSwapBuffersComplete(); | 159 void OnSwapBuffersComplete(); |
| 162 | 160 |
| 163 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 161 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
| 164 | 162 |
| 165 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 163 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 166 }; | 164 }; |
| 167 | 165 |
| 168 } // namespace cc | 166 } // namespace cc |
| 169 | 167 |
| 170 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 168 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |