| 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 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
| 17 #include "cc/output/overlay_candidate_validator.h" | 17 #include "cc/output/overlay_candidate_validator.h" |
| 18 #include "cc/output/software_output_device.h" | 18 #include "cc/output/software_output_device.h" |
| 19 #include "cc/output/vulkan_context_provider.h" | 19 #include "cc/output/vulkan_context_provider.h" |
| 20 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 20 | 21 |
| 21 namespace base { class SingleThreadTaskRunner; } | 22 namespace base { class SingleThreadTaskRunner; } |
| 22 | 23 |
| 23 namespace ui { | 24 namespace ui { |
| 24 class LatencyInfo; | 25 class LatencyInfo; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace gfx { | 28 namespace gfx { |
| 28 class Rect; | 29 class Rect; |
| 29 class Size; | 30 class Size; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 virtual void BindFramebuffer(); | 134 virtual void BindFramebuffer(); |
| 134 | 135 |
| 135 // The implementation may destroy or steal the contents of the CompositorFrame | 136 // The implementation may destroy or steal the contents of the CompositorFrame |
| 136 // passed in (though it will not take ownership of the CompositorFrame | 137 // passed in (though it will not take ownership of the CompositorFrame |
| 137 // itself). For successful swaps, the implementation must call | 138 // itself). For successful swaps, the implementation must call |
| 138 // OutputSurfaceClient::DidSwapBuffers() and eventually | 139 // OutputSurfaceClient::DidSwapBuffers() and eventually |
| 139 // DidSwapBuffersComplete(). | 140 // DidSwapBuffersComplete(). |
| 140 virtual void SwapBuffers(CompositorFrame* frame) = 0; | 141 virtual void SwapBuffers(CompositorFrame* frame) = 0; |
| 141 virtual void OnSwapBuffersComplete(); | 142 virtual void OnSwapBuffersComplete(); |
| 142 | 143 |
| 144 // Called by subclasses after receiving a response from the gpu process to a |
| 145 // query about whether a given set of textures is still in use by the OS |
| 146 // compositor. |
| 147 void DidReceiveTextureInUseResponses( |
| 148 const gpu::TextureInUseResponses& responses); |
| 149 |
| 143 bool HasClient() { return !!client_; } | 150 bool HasClient() { return !!client_; } |
| 144 | 151 |
| 145 // Get the class capable of informing cc of hardware overlay capability. | 152 // Get the class capable of informing cc of hardware overlay capability. |
| 146 virtual OverlayCandidateValidator* GetOverlayCandidateValidator() const; | 153 virtual OverlayCandidateValidator* GetOverlayCandidateValidator() const; |
| 147 | 154 |
| 148 // Returns true if a main image overlay plane should be scheduled. | 155 // Returns true if a main image overlay plane should be scheduled. |
| 149 virtual bool IsDisplayedAsOverlayPlane() const; | 156 virtual bool IsDisplayedAsOverlayPlane() const; |
| 150 | 157 |
| 151 // Get the texture for the main image's overlay. | 158 // Get the texture for the main image's overlay. |
| 152 virtual unsigned GetOverlayTextureId() const; | 159 virtual unsigned GetOverlayTextureId() const; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 bool external_stencil_test_enabled_ = false; | 202 bool external_stencil_test_enabled_ = false; |
| 196 | 203 |
| 197 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 204 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
| 198 | 205 |
| 199 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 206 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 200 }; | 207 }; |
| 201 | 208 |
| 202 } // namespace cc | 209 } // namespace cc |
| 203 | 210 |
| 204 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 211 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |