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 "cc/resources/returned_resource.h" |
20 #include "gpu/command_buffer/common/texture_in_use_response.h" | 21 #include "gpu/command_buffer/common/texture_in_use_response.h" |
21 | 22 |
22 namespace base { class SingleThreadTaskRunner; } | 23 namespace base { class SingleThreadTaskRunner; } |
23 | 24 |
24 namespace ui { | 25 namespace ui { |
25 class LatencyInfo; | 26 class LatencyInfo; |
26 } | 27 } |
27 | 28 |
28 namespace gfx { | 29 namespace gfx { |
29 class ColorSpace; | 30 class ColorSpace; |
30 class Rect; | 31 class Rect; |
31 class Size; | 32 class Size; |
32 class Transform; | 33 class Transform; |
33 } | 34 } |
34 | 35 |
35 namespace cc { | 36 namespace cc { |
36 | 37 |
37 class CompositorFrame; | 38 class CompositorFrame; |
38 class CompositorFrameAck; | |
39 struct ManagedMemoryPolicy; | 39 struct ManagedMemoryPolicy; |
40 class OutputSurfaceClient; | 40 class OutputSurfaceClient; |
41 | 41 |
42 // Represents the output surface for a compositor. The compositor owns | 42 // Represents the output surface for a compositor. The compositor owns |
43 // and manages its destruction. Its lifetime is: | 43 // and manages its destruction. Its lifetime is: |
44 // 1. Created on the main thread by the LayerTreeHost through its client. | 44 // 1. Created on the main thread by the LayerTreeHost through its client. |
45 // 2. Passed to the compositor thread and bound to a client via BindToClient. | 45 // 2. Passed to the compositor thread and bound to a client via BindToClient. |
46 // From here on, it will only be used on the compositor thread. | 46 // From here on, it will only be used on the compositor thread. |
47 // 3. If the 3D context is lost, then the compositor will delete the output | 47 // 3. If the 3D context is lost, then the compositor will delete the output |
48 // surface (on the compositor thread) and go back to step 1. | 48 // surface (on the compositor thread) and go back to step 1. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 scoped_refptr<ContextProvider> context_provider_; | 194 scoped_refptr<ContextProvider> context_provider_; |
195 scoped_refptr<ContextProvider> worker_context_provider_; | 195 scoped_refptr<ContextProvider> worker_context_provider_; |
196 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 196 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
197 std::unique_ptr<SoftwareOutputDevice> software_device_; | 197 std::unique_ptr<SoftwareOutputDevice> software_device_; |
198 gfx::Size surface_size_; | 198 gfx::Size surface_size_; |
199 float device_scale_factor_ = -1; | 199 float device_scale_factor_ = -1; |
200 bool has_alpha_ = true; | 200 bool has_alpha_ = true; |
201 base::ThreadChecker client_thread_checker_; | 201 base::ThreadChecker client_thread_checker_; |
202 | 202 |
203 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); | 203 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); |
204 void ReclaimResources(const CompositorFrameAck* ack); | 204 void ReclaimResources(const ReturnedResourceArray& resources); |
205 void SetExternalStencilTest(bool enabled); | 205 void SetExternalStencilTest(bool enabled); |
206 void DetachFromClientInternal(); | 206 void DetachFromClientInternal(); |
207 | 207 |
208 private: | 208 private: |
209 bool external_stencil_test_enabled_ = false; | 209 bool external_stencil_test_enabled_ = false; |
210 | 210 |
211 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 211 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
212 | 212 |
213 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 213 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
214 }; | 214 }; |
215 | 215 |
216 } // namespace cc | 216 } // namespace cc |
217 | 217 |
218 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 218 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |