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/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Sends frame data to the parent compositor. This should only be called when | 83 // Sends frame data to the parent compositor. This should only be called when |
84 // capabilities().has_parent_compositor. The implementation may destroy or | 84 // capabilities().has_parent_compositor. The implementation may destroy or |
85 // steal the contents of the CompositorFrame passed in. | 85 // steal the contents of the CompositorFrame passed in. |
86 virtual void SendFrameToParentCompositor(CompositorFrame* frame); | 86 virtual void SendFrameToParentCompositor(CompositorFrame* frame); |
87 | 87 |
88 virtual void EnsureBackbuffer(); | 88 virtual void EnsureBackbuffer(); |
89 virtual void DiscardBackbuffer(); | 89 virtual void DiscardBackbuffer(); |
90 | 90 |
91 virtual void Reshape(gfx::Size size, float scale_factor); | 91 virtual void Reshape(gfx::Size size, float scale_factor); |
| 92 virtual gfx::Size SurfaceSize() const; |
92 | 93 |
93 virtual void BindFramebuffer(); | 94 virtual void BindFramebuffer(); |
94 | 95 |
95 virtual void PostSubBuffer(gfx::Rect rect, const ui::LatencyInfo&); | 96 virtual void PostSubBuffer(gfx::Rect rect, const ui::LatencyInfo&); |
96 virtual void SwapBuffers(const ui::LatencyInfo&); | 97 virtual void SwapBuffers(const ui::LatencyInfo&); |
97 | 98 |
98 // Notifies frame-rate smoothness preference. If true, all non-critical | 99 // Notifies frame-rate smoothness preference. If true, all non-critical |
99 // processing should be stopped, or lowered in priority. | 100 // processing should be stopped, or lowered in priority. |
100 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 101 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
101 | 102 |
102 // Requests a BeginFrame notification from the output surface. The | 103 // Requests a BeginFrame notification from the output surface. The |
103 // notification will be delivered by calling | 104 // notification will be delivered by calling |
104 // OutputSurfaceClient::BeginFrame until the callback is disabled. | 105 // OutputSurfaceClient::BeginFrame until the callback is disabled. |
105 virtual void SetNeedsBeginFrame(bool enable) {} | 106 virtual void SetNeedsBeginFrame(bool enable) {} |
106 | 107 |
107 protected: | 108 protected: |
108 OutputSurfaceClient* client_; | 109 OutputSurfaceClient* client_; |
109 struct cc::OutputSurface::Capabilities capabilities_; | 110 struct cc::OutputSurface::Capabilities capabilities_; |
110 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | 111 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
111 scoped_ptr<cc::SoftwareOutputDevice> software_device_; | 112 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
112 bool has_gl_discard_backbuffer_; | 113 bool has_gl_discard_backbuffer_; |
| 114 gfx::Size surface_size_; |
| 115 float device_scale_factor_; |
113 | 116 |
114 scoped_ptr<OutputSurfaceCallbacks> callbacks_; | 117 scoped_ptr<OutputSurfaceCallbacks> callbacks_; |
115 | 118 |
116 private: | 119 private: |
117 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 120 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
118 }; | 121 }; |
119 | 122 |
120 } // namespace cc | 123 } // namespace cc |
121 | 124 |
122 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 125 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |