| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Notifies frame-rate smoothness preference. If true, all non-critical | 118 // Notifies frame-rate smoothness preference. If true, all non-critical |
| 119 // processing should be stopped, or lowered in priority. | 119 // processing should be stopped, or lowered in priority. |
| 120 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 120 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
| 121 | 121 |
| 122 // Requests a BeginFrame notification from the output surface. The | 122 // Requests a BeginFrame notification from the output surface. The |
| 123 // notification will be delivered by calling | 123 // notification will be delivered by calling |
| 124 // OutputSurfaceClient::BeginFrame until the callback is disabled. | 124 // OutputSurfaceClient::BeginFrame until the callback is disabled. |
| 125 virtual void SetNeedsBeginFrame(bool enable); | 125 virtual void SetNeedsBeginFrame(bool enable); |
| 126 | 126 |
| 127 bool HasClient() { return !!client_; } | 127 bool HasClient() { return !!client_; } |
| 128 bool IsLost() { return context_is_lost_; } |
| 128 | 129 |
| 129 protected: | 130 protected: |
| 130 // Synchronously initialize context3d and enter hardware mode. | 131 // Synchronously initialize context3d and enter hardware mode. |
| 131 // This can only supported in threaded compositing mode. | 132 // This can only supported in threaded compositing mode. |
| 132 // |offscreen_context_provider| should match what is returned by | 133 // |offscreen_context_provider| should match what is returned by |
| 133 // LayerTreeClient::OffscreenContextProviderForCompositorThread. | 134 // LayerTreeClient::OffscreenContextProviderForCompositorThread. |
| 134 bool InitializeAndSetContext3d( | 135 bool InitializeAndSetContext3d( |
| 135 scoped_refptr<ContextProvider> context_provider, | 136 scoped_refptr<ContextProvider> context_provider, |
| 136 scoped_refptr<ContextProvider> offscreen_context_provider); | 137 scoped_refptr<ContextProvider> offscreen_context_provider); |
| 137 void ReleaseGL(); | 138 void ReleaseGL(); |
| 138 | 139 |
| 139 void PostSwapBuffersComplete(); | 140 void PostSwapBuffersComplete(); |
| 140 | 141 |
| 141 struct cc::OutputSurface::Capabilities capabilities_; | 142 struct cc::OutputSurface::Capabilities capabilities_; |
| 142 scoped_refptr<ContextProvider> context_provider_; | 143 scoped_refptr<ContextProvider> context_provider_; |
| 143 scoped_ptr<cc::SoftwareOutputDevice> software_device_; | 144 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
| 145 bool context_is_lost_; |
| 144 bool has_gl_discard_backbuffer_; | 146 bool has_gl_discard_backbuffer_; |
| 145 bool has_swap_buffers_complete_callback_; | 147 bool has_swap_buffers_complete_callback_; |
| 146 gfx::Size surface_size_; | 148 gfx::Size surface_size_; |
| 147 float device_scale_factor_; | 149 float device_scale_factor_; |
| 148 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 150 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
| 149 | 151 |
| 150 // The FrameRateController is deprecated. | 152 // The FrameRateController is deprecated. |
| 151 // Platforms should move to native BeginFrames instead. | 153 // Platforms should move to native BeginFrames instead. |
| 152 void OnVSyncParametersChanged(base::TimeTicks timebase, | 154 void OnVSyncParametersChanged(base::TimeTicks timebase, |
| 153 base::TimeDelta interval); | 155 base::TimeDelta interval); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // check_for_retroactive_begin_frame_pending_ is used to avoid posting | 195 // check_for_retroactive_begin_frame_pending_ is used to avoid posting |
| 194 // redundant checks for a retroactive BeginFrame. | 196 // redundant checks for a retroactive BeginFrame. |
| 195 bool check_for_retroactive_begin_frame_pending_; | 197 bool check_for_retroactive_begin_frame_pending_; |
| 196 | 198 |
| 197 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 199 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 } // namespace cc | 202 } // namespace cc |
| 201 | 203 |
| 202 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 204 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |