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 "cc/resources/returned_resource.h" |
21 #include "gpu/command_buffer/common/texture_in_use_response.h" | 21 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 22 #include "ui/gfx/color_space.h" |
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 ColorSpace; | 29 class ColorSpace; |
29 class Rect; | 30 class Rect; |
30 class Size; | 31 class Size; |
31 class Transform; | 32 class Transform; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 virtual void EnsureBackbuffer(); | 123 virtual void EnsureBackbuffer(); |
123 virtual void DiscardBackbuffer(); | 124 virtual void DiscardBackbuffer(); |
124 | 125 |
125 virtual void Reshape(const gfx::Size& size, | 126 virtual void Reshape(const gfx::Size& size, |
126 float scale_factor, | 127 float scale_factor, |
127 const gfx::ColorSpace& color_space, | 128 const gfx::ColorSpace& color_space, |
128 bool alpha); | 129 bool alpha); |
129 gfx::Size SurfaceSize() const { return surface_size_; } | 130 gfx::Size SurfaceSize() const { return surface_size_; } |
130 float device_scale_factor() const { return device_scale_factor_; } | 131 float device_scale_factor() const { return device_scale_factor_; } |
| 132 const gfx::ColorSpace& color_space() const { return color_space_; } |
131 | 133 |
132 // If supported, this causes a ReclaimResources for all resources that are | 134 // If supported, this causes a ReclaimResources for all resources that are |
133 // currently in use. | 135 // currently in use. |
134 virtual void ForceReclaimResources() {} | 136 virtual void ForceReclaimResources() {} |
135 | 137 |
136 virtual void BindFramebuffer(); | 138 virtual void BindFramebuffer(); |
137 // Gives the GL internal format that should be used for calling CopyTexImage2D | 139 // Gives the GL internal format that should be used for calling CopyTexImage2D |
138 // when the framebuffer is bound via BindFramebuffer(). | 140 // when the framebuffer is bound via BindFramebuffer(). |
139 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; | 141 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; |
140 | 142 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 OutputSurfaceClient* client_ = nullptr; | 190 OutputSurfaceClient* client_ = nullptr; |
189 | 191 |
190 struct OutputSurface::Capabilities capabilities_; | 192 struct OutputSurface::Capabilities capabilities_; |
191 scoped_refptr<ContextProvider> context_provider_; | 193 scoped_refptr<ContextProvider> context_provider_; |
192 scoped_refptr<ContextProvider> worker_context_provider_; | 194 scoped_refptr<ContextProvider> worker_context_provider_; |
193 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 195 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
194 std::unique_ptr<SoftwareOutputDevice> software_device_; | 196 std::unique_ptr<SoftwareOutputDevice> software_device_; |
195 gfx::Size surface_size_; | 197 gfx::Size surface_size_; |
196 float device_scale_factor_ = -1; | 198 float device_scale_factor_ = -1; |
197 bool has_alpha_ = true; | 199 bool has_alpha_ = true; |
| 200 gfx::ColorSpace color_space_; |
198 base::ThreadChecker client_thread_checker_; | 201 base::ThreadChecker client_thread_checker_; |
199 | 202 |
200 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); | 203 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); |
201 void ReclaimResources(const ReturnedResourceArray& resources); | 204 void ReclaimResources(const ReturnedResourceArray& resources); |
202 void SetExternalStencilTest(bool enabled); | 205 void SetExternalStencilTest(bool enabled); |
203 void DetachFromClientInternal(); | 206 void DetachFromClientInternal(); |
204 | 207 |
205 private: | 208 private: |
206 bool external_stencil_test_enabled_ = false; | 209 bool external_stencil_test_enabled_ = false; |
207 | 210 |
208 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 211 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
209 | 212 |
210 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 213 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
211 }; | 214 }; |
212 | 215 |
213 } // namespace cc | 216 } // namespace cc |
214 | 217 |
215 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 218 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |