Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: cc/output/output_surface.h

Issue 2374183006: Remove GLFrameData from CompositorFrame. (Closed)
Patch Set: Address comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 virtual void ApplyExternalStencil() = 0; 125 virtual void ApplyExternalStencil() = 0;
126 126
127 // Gives the GL internal format that should be used for calling CopyTexImage2D 127 // Gives the GL internal format that should be used for calling CopyTexImage2D
128 // when the framebuffer is bound via BindFramebuffer(). 128 // when the framebuffer is bound via BindFramebuffer().
129 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; 129 virtual uint32_t GetFramebufferCopyTextureFormat() = 0;
130 130
131 // The implementation may destroy or steal the contents of the CompositorFrame 131 // The implementation may destroy or steal the contents of the CompositorFrame
132 // passed in (though it will not take ownership of the CompositorFrame 132 // passed in (though it will not take ownership of the CompositorFrame
133 // itself). For successful swaps, the implementation must call 133 // itself). For successful swaps, the implementation must call
134 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. 134 // OutputSurfaceClient::DidSwapBuffersComplete() eventually.
135 virtual void SwapBuffers(CompositorFrame frame) = 0; 135 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0;
136 136
137 // base::trace_event::MemoryDumpProvider implementation. 137 // base::trace_event::MemoryDumpProvider implementation.
138 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 138 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
139 base::trace_event::ProcessMemoryDump* pmd) override; 139 base::trace_event::ProcessMemoryDump* pmd) override;
140 140
141 protected: 141 protected:
142 void PostSwapBuffersComplete(); 142 void PostSwapBuffersComplete();
143 143
144 // Used internally for the context provider to inform the client about loss, 144 // Used internally for the context provider to inform the client about loss,
145 // and can be overridden to change behaviour instead of informing the client. 145 // and can be overridden to change behaviour instead of informing the client.
(...skipping 16 matching lines...) Expand all
162 void OnSwapBuffersComplete(); 162 void OnSwapBuffersComplete();
163 163
164 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; 164 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
165 165
166 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 166 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
167 }; 167 };
168 168
169 } // namespace cc 169 } // namespace cc
170 170
171 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ 171 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698