OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "cc/output/output_surface.h" | 11 #include "cc/output/output_surface.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 class SoftwareOutputDevice; | 15 class SoftwareOutputDevice; |
16 } | 16 } |
17 | 17 |
18 namespace display_compositor { | 18 namespace display_compositor { |
19 class CompositorOverlayCandidateValidator; | 19 class CompositorOverlayCandidateValidator; |
20 } | 20 } |
21 | 21 |
22 namespace gfx { | 22 namespace gfx { |
23 enum class SwapResult; | 23 enum class SwapResult; |
24 } | 24 } |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class ReflectorImpl; | 27 class ReflectorImpl; |
| 28 class GpuVSyncControl; |
28 | 29 |
29 class CONTENT_EXPORT BrowserCompositorOutputSurface | 30 class CONTENT_EXPORT BrowserCompositorOutputSurface |
30 : public cc::OutputSurface { | 31 : public cc::OutputSurface { |
31 public: | 32 public: |
32 using UpdateVSyncParametersCallback = | 33 using UpdateVSyncParametersCallback = |
33 base::Callback<void(base::TimeTicks timebase, base::TimeDelta interval)>; | 34 base::Callback<void(base::TimeTicks timebase, base::TimeDelta interval)>; |
34 | 35 |
35 ~BrowserCompositorOutputSurface() override; | 36 ~BrowserCompositorOutputSurface() override; |
36 | 37 |
37 // cc::OutputSurface implementation. | 38 // cc::OutputSurface implementation. |
38 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; | 39 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; |
39 bool HasExternalStencilTest() const override; | 40 bool HasExternalStencilTest() const override; |
40 void ApplyExternalStencil() override; | 41 void ApplyExternalStencil() override; |
41 | 42 |
42 void SetReflector(ReflectorImpl* reflector); | 43 void SetReflector(ReflectorImpl* reflector); |
43 | 44 |
44 // Called when |reflector_| was updated. | 45 // Called when |reflector_| was updated. |
45 virtual void OnReflectorChanged(); | 46 virtual void OnReflectorChanged(); |
46 | 47 |
| 48 // Called to determine if this type of OutputSurface provides GPU VSync. |
| 49 virtual GpuVSyncControl* GetVSyncControl(); |
| 50 |
47 #if defined(OS_MACOSX) | 51 #if defined(OS_MACOSX) |
48 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; | 52 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; |
49 #endif | 53 #endif |
50 | 54 |
51 protected: | 55 protected: |
52 // Constructor used by the accelerated implementation. | 56 // Constructor used by the accelerated implementation. |
53 BrowserCompositorOutputSurface( | 57 BrowserCompositorOutputSurface( |
54 scoped_refptr<cc::ContextProvider> context, | 58 scoped_refptr<cc::ContextProvider> context, |
55 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, | 59 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, |
56 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 60 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
(...skipping 15 matching lines...) Expand all Loading... |
72 private: | 76 private: |
73 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 77 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
74 overlay_candidate_validator_; | 78 overlay_candidate_validator_; |
75 | 79 |
76 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 80 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
77 }; | 81 }; |
78 | 82 |
79 } // namespace content | 83 } // namespace content |
80 | 84 |
81 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 85 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |