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" | |
16 #include "cc/output/context_provider.h" | 15 #include "cc/output/context_provider.h" |
17 #include "cc/output/overlay_candidate_validator.h" | 16 #include "cc/output/overlay_candidate_validator.h" |
18 #include "cc/output/software_output_device.h" | 17 #include "cc/output/software_output_device.h" |
19 | 18 |
20 namespace base { class SingleThreadTaskRunner; } | 19 namespace base { class SingleThreadTaskRunner; } |
21 | 20 |
22 namespace ui { struct LatencyInfo; } | 21 namespace ui { struct LatencyInfo; } |
23 | 22 |
24 namespace gfx { | 23 namespace gfx { |
25 class Rect; | 24 class Rect; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 virtual void EnsureBackbuffer(); | 105 virtual void EnsureBackbuffer(); |
107 virtual void DiscardBackbuffer(); | 106 virtual void DiscardBackbuffer(); |
108 | 107 |
109 virtual void Reshape(const gfx::Size& size, float scale_factor); | 108 virtual void Reshape(const gfx::Size& size, float scale_factor); |
110 virtual gfx::Size SurfaceSize() const; | 109 virtual gfx::Size SurfaceSize() const; |
111 | 110 |
112 virtual void BindFramebuffer(); | 111 virtual void BindFramebuffer(); |
113 | 112 |
114 // The implementation may destroy or steal the contents of the CompositorFrame | 113 // The implementation may destroy or steal the contents of the CompositorFrame |
115 // passed in (though it will not take ownership of the CompositorFrame | 114 // passed in (though it will not take ownership of the CompositorFrame |
116 // itself). | 115 // itself). For successful swaps, the implementation must call |
117 virtual void SwapBuffers(CompositorFrame* frame); | 116 // OutputSurfaceClient::DidSwapBuffers() and eventually |
| 117 // DidSwapBuffersComplete(). |
| 118 virtual void SwapBuffers(CompositorFrame* frame) = 0; |
118 virtual void OnSwapBuffersComplete(); | 119 virtual void OnSwapBuffersComplete(); |
119 | 120 |
120 // Notifies frame-rate smoothness preference. If true, all non-critical | 121 // Notifies frame-rate smoothness preference. If true, all non-critical |
121 // processing should be stopped, or lowered in priority. | 122 // processing should be stopped, or lowered in priority. |
122 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 123 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
123 | 124 |
124 // Requests a BeginFrame notification from the output surface. The | 125 // Requests a BeginFrame notification from the output surface. The |
125 // notification will be delivered by calling | 126 // notification will be delivered by calling |
126 // OutputSurfaceClient::BeginFrame until the callback is disabled. | 127 // OutputSurfaceClient::BeginFrame until the callback is disabled. |
127 virtual void SetNeedsBeginFrame(bool enable) {} | 128 virtual void SetNeedsBeginFrame(bool enable) {} |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool external_stencil_test_enabled_; | 176 bool external_stencil_test_enabled_; |
176 | 177 |
177 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 178 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
178 | 179 |
179 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 180 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
180 }; | 181 }; |
181 | 182 |
182 } // namespace cc | 183 } // namespace cc |
183 | 184 |
184 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 185 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |