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 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. | 8 #define USE_CC_OUTPUT_SURFACE // TODO(danakj): Remove this. |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
13 #include "cc/output/software_output_device.h" | 13 #include "cc/output/software_output_device.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Rect; | 17 class Rect; |
18 class Size; | 18 class Size; |
19 } | 19 } |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 | 22 |
23 class CompositorFrame; | 23 class CompositorFrame; |
24 class OutputSurfaceClient; | 24 class OutputSurfaceClient; |
| 25 class OutputSurfaceCallbacks; |
25 | 26 |
26 // Represents the output surface for a compositor. The compositor owns | 27 // Represents the output surface for a compositor. The compositor owns |
27 // and manages its destruction. Its lifetime is: | 28 // and manages its destruction. Its lifetime is: |
28 // 1. Created on the main thread by the LayerTreeHost through its client. | 29 // 1. Created on the main thread by the LayerTreeHost through its client. |
29 // 2. Passed to the compositor thread and bound to a client via BindToClient. | 30 // 2. Passed to the compositor thread and bound to a client via BindToClient. |
30 // From here on, it will only be used on the compositor thread. | 31 // From here on, it will only be used on the compositor thread. |
31 // 3. If the 3D context is lost, then the compositor will delete the output | 32 // 3. If the 3D context is lost, then the compositor will delete the output |
32 // surface (on the compositor thread) and go back to step 1. | 33 // surface (on the compositor thread) and go back to step 1. |
33 class CC_EXPORT OutputSurface { | 34 class CC_EXPORT OutputSurface { |
34 public: | 35 public: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // processing should be stopped, or lowered in priority. | 92 // processing should be stopped, or lowered in priority. |
92 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 93 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
93 | 94 |
94 protected: | 95 protected: |
95 OutputSurfaceClient* client_; | 96 OutputSurfaceClient* client_; |
96 struct cc::OutputSurface::Capabilities capabilities_; | 97 struct cc::OutputSurface::Capabilities capabilities_; |
97 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | 98 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
98 scoped_ptr<cc::SoftwareOutputDevice> software_device_; | 99 scoped_ptr<cc::SoftwareOutputDevice> software_device_; |
99 bool has_gl_discard_backbuffer_; | 100 bool has_gl_discard_backbuffer_; |
100 | 101 |
| 102 scoped_ptr<OutputSurfaceCallbacks> callbacks_; |
| 103 |
101 private: | 104 private: |
102 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 105 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
103 }; | 106 }; |
104 | 107 |
105 } // namespace cc | 108 } // namespace cc |
106 | 109 |
107 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 110 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |