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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
15 #include "cc/base/rolling_time_delta_history.h" | 15 #include "cc/base/rolling_time_delta_history.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/software_output_device.h" | 18 #include "cc/output/software_output_device.h" |
18 #include "cc/scheduler/frame_rate_controller.h" | 19 #include "cc/scheduler/frame_rate_controller.h" |
19 | 20 |
20 namespace base { class SingleThreadTaskRunner; } | 21 namespace base { class SingleThreadTaskRunner; } |
21 | 22 |
22 namespace ui { struct LatencyInfo; } | 23 namespace ui { struct LatencyInfo; } |
23 | 24 |
24 namespace gfx { | 25 namespace gfx { |
25 class Rect; | 26 class Rect; |
26 class Size; | 27 class Size; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // notification will be delivered by calling | 133 // notification will be delivered by calling |
133 // OutputSurfaceClient::BeginImplFrame until the callback is disabled. | 134 // OutputSurfaceClient::BeginImplFrame until the callback is disabled. |
134 virtual void SetNeedsBeginImplFrame(bool enable); | 135 virtual void SetNeedsBeginImplFrame(bool enable); |
135 | 136 |
136 bool HasClient() { return !!client_; } | 137 bool HasClient() { return !!client_; } |
137 | 138 |
138 // Returns an estimate of the current GPU latency. When only a software | 139 // Returns an estimate of the current GPU latency. When only a software |
139 // device is present, returns 0. | 140 // device is present, returns 0. |
140 base::TimeDelta GpuLatencyEstimate(); | 141 base::TimeDelta GpuLatencyEstimate(); |
141 | 142 |
| 143 // Get the class capable of informing cc of hardware overlay capability. |
| 144 OverlayCandidateValidator* overlay_candidate_validator() const { |
| 145 return overlay_candidate_validator_.get(); |
| 146 } |
| 147 |
142 protected: | 148 protected: |
143 // Synchronously initialize context3d and enter hardware mode. | 149 // Synchronously initialize context3d and enter hardware mode. |
144 // This can only supported in threaded compositing mode. | 150 // This can only supported in threaded compositing mode. |
145 // |offscreen_context_provider| should match what is returned by | 151 // |offscreen_context_provider| should match what is returned by |
146 // LayerTreeClient::OffscreenContextProvider(). | 152 // LayerTreeClient::OffscreenContextProvider(). |
147 bool InitializeAndSetContext3d( | 153 bool InitializeAndSetContext3d( |
148 scoped_refptr<ContextProvider> context_provider, | 154 scoped_refptr<ContextProvider> context_provider, |
149 scoped_refptr<ContextProvider> offscreen_context_provider); | 155 scoped_refptr<ContextProvider> offscreen_context_provider); |
150 void ReleaseGL(); | 156 void ReleaseGL(); |
151 | 157 |
152 void PostSwapBuffersComplete(); | 158 void PostSwapBuffersComplete(); |
153 | 159 |
154 struct OutputSurface::Capabilities capabilities_; | 160 struct OutputSurface::Capabilities capabilities_; |
155 scoped_refptr<ContextProvider> context_provider_; | 161 scoped_refptr<ContextProvider> context_provider_; |
156 scoped_ptr<SoftwareOutputDevice> software_device_; | 162 scoped_ptr<SoftwareOutputDevice> software_device_; |
| 163 scoped_ptr<OverlayCandidateValidator> overlay_candidate_validator_; |
157 gfx::Size surface_size_; | 164 gfx::Size surface_size_; |
158 float device_scale_factor_; | 165 float device_scale_factor_; |
159 | 166 |
160 // The FrameRateController is deprecated. | 167 // The FrameRateController is deprecated. |
161 // Platforms should move to native BeginImplFrames instead. | 168 // Platforms should move to native BeginImplFrames instead. |
162 void CommitVSyncParameters(base::TimeTicks timebase, | 169 void CommitVSyncParameters(base::TimeTicks timebase, |
163 base::TimeDelta interval); | 170 base::TimeDelta interval); |
164 virtual void FrameRateControllerTick(bool throttled, | 171 virtual void FrameRateControllerTick(bool throttled, |
165 const BeginFrameArgs& args) OVERRIDE; | 172 const BeginFrameArgs& args) OVERRIDE; |
166 scoped_ptr<FrameRateController> frame_rate_controller_; | 173 scoped_ptr<FrameRateController> frame_rate_controller_; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 std::deque<unsigned> available_gpu_latency_query_ids_; | 218 std::deque<unsigned> available_gpu_latency_query_ids_; |
212 std::deque<unsigned> pending_gpu_latency_query_ids_; | 219 std::deque<unsigned> pending_gpu_latency_query_ids_; |
213 RollingTimeDeltaHistory gpu_latency_history_; | 220 RollingTimeDeltaHistory gpu_latency_history_; |
214 | 221 |
215 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 222 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
216 }; | 223 }; |
217 | 224 |
218 } // namespace cc | 225 } // namespace cc |
219 | 226 |
220 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 227 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |