| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 explicit OutputSurface(scoped_refptr<ContextProvider> context_provider); | 61 explicit OutputSurface(scoped_refptr<ContextProvider> context_provider); |
| 62 // Constructor for software compositing. | 62 // Constructor for software compositing. |
| 63 explicit OutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device); | 63 explicit OutputSurface(std::unique_ptr<SoftwareOutputDevice> software_device); |
| 64 // Constructor for Vulkan-based compositing. | 64 // Constructor for Vulkan-based compositing. |
| 65 explicit OutputSurface( | 65 explicit OutputSurface( |
| 66 scoped_refptr<VulkanContextProvider> vulkan_context_provider); | 66 scoped_refptr<VulkanContextProvider> vulkan_context_provider); |
| 67 | 67 |
| 68 virtual ~OutputSurface(); | 68 virtual ~OutputSurface(); |
| 69 | 69 |
| 70 // Called by the compositor on the compositor thread. This is a place where | 70 // Called by the compositor on the compositor thread. This is a place where |
| 71 // thread-specific data for the output surface can be initialized, since from | 71 // thread-specific data for the output surface can be initialized. The |
| 72 // this point to when DetachFromClient() is called the output surface will | 72 // OutputSurface will be destroyed on the same thread that BoundToClient is |
| 73 // only be used on the compositor thread. | 73 // called on. |
| 74 // The caller should call DetachFromClient() on the same thread before | |
| 75 // destroying the OutputSurface, even if this fails. And BindToClient should | |
| 76 // not be called twice for a given OutputSurface. | |
| 77 virtual bool BindToClient(OutputSurfaceClient* client); | 74 virtual bool BindToClient(OutputSurfaceClient* client); |
| 78 | 75 |
| 79 const Capabilities& capabilities() const { return capabilities_; } | 76 const Capabilities& capabilities() const { return capabilities_; } |
| 80 | 77 |
| 81 // Obtain the 3d context or the software device associated with this output | 78 // Obtain the 3d context or the software device associated with this output |
| 82 // surface. Either of these may return a null pointer, but not both. | 79 // surface. Either of these may return a null pointer, but not both. |
| 83 // In the event of a lost context, the entire output surface should be | 80 // In the event of a lost context, the entire output surface should be |
| 84 // recreated. | 81 // recreated. |
| 85 ContextProvider* context_provider() const { return context_provider_.get(); } | 82 ContextProvider* context_provider() const { return context_provider_.get(); } |
| 86 VulkanContextProvider* vulkan_context_provider() const { | 83 VulkanContextProvider* vulkan_context_provider() const { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 std::unique_ptr<SoftwareOutputDevice> software_device_; | 137 std::unique_ptr<SoftwareOutputDevice> software_device_; |
| 141 base::ThreadChecker thread_checker_; | 138 base::ThreadChecker thread_checker_; |
| 142 | 139 |
| 143 private: | 140 private: |
| 144 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 141 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 145 }; | 142 }; |
| 146 | 143 |
| 147 } // namespace cc | 144 } // namespace cc |
| 148 | 145 |
| 149 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 146 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |