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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace gfx { | 29 namespace gfx { |
30 class ColorSpace; | 30 class ColorSpace; |
31 class Rect; | 31 class Rect; |
32 class Size; | 32 class Size; |
33 class Transform; | 33 class Transform; |
34 } | 34 } |
35 | 35 |
36 namespace cc { | 36 namespace cc { |
37 | 37 |
38 class CompositorFrame; | |
39 struct ManagedMemoryPolicy; | 38 struct ManagedMemoryPolicy; |
40 class OutputSurfaceClient; | 39 class OutputSurfaceClient; |
| 40 class OutputSurfaceFrame; |
41 | 41 |
42 // Represents the output surface for a compositor. The compositor owns | 42 // Represents the output surface for a compositor. The compositor owns |
43 // and manages its destruction. Its lifetime is: | 43 // and manages its destruction. Its lifetime is: |
44 // 1. Created on the main thread by the LayerTreeHost through its client. | 44 // 1. Created on the main thread by the LayerTreeHost through its client. |
45 // 2. Passed to the compositor thread and bound to a client via BindToClient. | 45 // 2. Passed to the compositor thread and bound to a client via BindToClient. |
46 // From here on, it will only be used on the compositor thread. | 46 // From here on, it will only be used on the compositor thread. |
47 // 3. If the 3D context is lost, then the compositor will delete the output | 47 // 3. If the 3D context is lost, then the compositor will delete the output |
48 // surface (on the compositor thread) and go back to step 1. | 48 // surface (on the compositor thread) and go back to step 1. |
49 class CC_EXPORT OutputSurface : public base::trace_event::MemoryDumpProvider { | 49 class CC_EXPORT OutputSurface : public base::trace_event::MemoryDumpProvider { |
50 public: | 50 public: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 virtual void ApplyExternalStencil() = 0; | 124 virtual void ApplyExternalStencil() = 0; |
125 | 125 |
126 // Gives the GL internal format that should be used for calling CopyTexImage2D | 126 // Gives the GL internal format that should be used for calling CopyTexImage2D |
127 // when the framebuffer is bound via BindFramebuffer(). | 127 // when the framebuffer is bound via BindFramebuffer(). |
128 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; | 128 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; |
129 | 129 |
130 // The implementation may destroy or steal the contents of the CompositorFrame | 130 // The implementation may destroy or steal the contents of the CompositorFrame |
131 // passed in (though it will not take ownership of the CompositorFrame | 131 // passed in (though it will not take ownership of the CompositorFrame |
132 // itself). For successful swaps, the implementation must call | 132 // itself). For successful swaps, the implementation must call |
133 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. | 133 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. |
134 virtual void SwapBuffers(CompositorFrame frame) = 0; | 134 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0; |
135 | 135 |
136 // base::trace_event::MemoryDumpProvider implementation. | 136 // base::trace_event::MemoryDumpProvider implementation. |
137 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 137 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
138 base::trace_event::ProcessMemoryDump* pmd) override; | 138 base::trace_event::ProcessMemoryDump* pmd) override; |
139 | 139 |
140 protected: | 140 protected: |
141 void PostSwapBuffersComplete(); | 141 void PostSwapBuffersComplete(); |
142 | 142 |
143 // Used internally for the context provider to inform the client about loss, | 143 // Used internally for the context provider to inform the client about loss, |
144 // and can be overridden to change behaviour instead of informing the client. | 144 // and can be overridden to change behaviour instead of informing the client. |
(...skipping 16 matching lines...) Expand all Loading... |
161 void OnSwapBuffersComplete(); | 161 void OnSwapBuffersComplete(); |
162 | 162 |
163 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 163 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
164 | 164 |
165 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 165 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
166 }; | 166 }; |
167 | 167 |
168 } // namespace cc | 168 } // namespace cc |
169 | 169 |
170 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 170 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |