| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 const gfx::ColorSpace& color_space, | 111 const gfx::ColorSpace& color_space, |
| 112 bool has_alpha) = 0; | 112 bool has_alpha) = 0; |
| 113 | 113 |
| 114 virtual bool HasExternalStencilTest() const = 0; | 114 virtual bool HasExternalStencilTest() const = 0; |
| 115 virtual void ApplyExternalStencil() = 0; | 115 virtual void ApplyExternalStencil() = 0; |
| 116 | 116 |
| 117 // Gives the GL internal format that should be used for calling CopyTexImage2D | 117 // Gives the GL internal format that should be used for calling CopyTexImage2D |
| 118 // when the framebuffer is bound via BindFramebuffer(). | 118 // when the framebuffer is bound via BindFramebuffer(). |
| 119 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; | 119 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; |
| 120 | 120 |
| 121 // The implementation may destroy or steal the contents of the CompositorFrame | 121 // Swaps the current backbuffer to the screen. For successful swaps, the |
| 122 // passed in (though it will not take ownership of the CompositorFrame | 122 // implementation must call OutputSurfaceClient::DidReceiveSwapBuffersAck() |
| 123 // itself). For successful swaps, the implementation must call | 123 // after returning from this method in order to unblock the next frame. |
| 124 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. | |
| 125 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; | 124 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; |
| 126 | 125 |
| 127 protected: | 126 protected: |
| 128 // Used internally for the context provider to inform the client about loss, | 127 // Used internally for the context provider to inform the client about loss, |
| 129 // and can be overridden to change behaviour instead of informing the client. | 128 // and can be overridden to change behaviour instead of informing the client. |
| 130 virtual void DidLoseOutputSurface(); | 129 virtual void DidLoseOutputSurface(); |
| 131 | 130 |
| 132 OutputSurfaceClient* client_ = nullptr; | 131 OutputSurfaceClient* client_ = nullptr; |
| 133 | 132 |
| 134 struct OutputSurface::Capabilities capabilities_; | 133 struct OutputSurface::Capabilities capabilities_; |
| 135 scoped_refptr<ContextProvider> context_provider_; | 134 scoped_refptr<ContextProvider> context_provider_; |
| 136 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 135 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
| 137 std::unique_ptr<SoftwareOutputDevice> software_device_; | 136 std::unique_ptr<SoftwareOutputDevice> software_device_; |
| 138 base::ThreadChecker thread_checker_; | 137 base::ThreadChecker thread_checker_; |
| 139 | 138 |
| 140 private: | 139 private: |
| 141 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 140 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 142 }; | 141 }; |
| 143 | 142 |
| 144 } // namespace cc | 143 } // namespace cc |
| 145 | 144 |
| 146 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 145 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |