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

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

Issue 2374183006: Remove GLFrameData from CompositorFrame. (Closed)
Patch Set: Rebase + fix includes. 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
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 #include "base/trace_event/memory_dump_provider.h" 15 #include "base/trace_event/memory_dump_provider.h"
16 #include "cc/base/cc_export.h" 16 #include "cc/base/cc_export.h"
17 #include "cc/output/context_provider.h" 17 #include "cc/output/context_provider.h"
18 #include "cc/output/output_surface_frame.h"
danakj 2016/10/04 21:58:40 forward declare it instead?
kylechar 2016/10/05 13:45:54 Done.
18 #include "cc/output/overlay_candidate_validator.h" 19 #include "cc/output/overlay_candidate_validator.h"
19 #include "cc/output/software_output_device.h" 20 #include "cc/output/software_output_device.h"
20 #include "cc/output/vulkan_context_provider.h" 21 #include "cc/output/vulkan_context_provider.h"
21 #include "cc/resources/returned_resource.h" 22 #include "cc/resources/returned_resource.h"
22 #include "gpu/command_buffer/common/texture_in_use_response.h" 23 #include "gpu/command_buffer/common/texture_in_use_response.h"
23 #include "ui/gfx/color_space.h" 24 #include "ui/gfx/color_space.h"
24 25
25 namespace ui { 26 namespace ui {
26 class LatencyInfo; 27 class LatencyInfo;
27 } 28 }
28 29
29 namespace gfx { 30 namespace gfx {
30 class ColorSpace; 31 class ColorSpace;
31 class Rect; 32 class Rect;
32 class Size; 33 class Size;
33 class Transform; 34 class Transform;
34 } 35 }
35 36
36 namespace cc { 37 namespace cc {
37 38
38 class CompositorFrame; 39 class CompositorFrame;
danakj 2016/10/04 21:58:40 remove this
kylechar 2016/10/05 13:45:54 Done.
39 struct ManagedMemoryPolicy; 40 struct ManagedMemoryPolicy;
40 class OutputSurfaceClient; 41 class OutputSurfaceClient;
41 42
42 // Represents the output surface for a compositor. The compositor owns 43 // Represents the output surface for a compositor. The compositor owns
43 // and manages its destruction. Its lifetime is: 44 // and manages its destruction. Its lifetime is:
44 // 1. Created on the main thread by the LayerTreeHost through its client. 45 // 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. 46 // 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. 47 // 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 48 // 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. 49 // surface (on the compositor thread) and go back to step 1.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 virtual void ApplyExternalStencil() = 0; 126 virtual void ApplyExternalStencil() = 0;
126 127
127 // Gives the GL internal format that should be used for calling CopyTexImage2D 128 // Gives the GL internal format that should be used for calling CopyTexImage2D
128 // when the framebuffer is bound via BindFramebuffer(). 129 // when the framebuffer is bound via BindFramebuffer().
129 virtual uint32_t GetFramebufferCopyTextureFormat() = 0; 130 virtual uint32_t GetFramebufferCopyTextureFormat() = 0;
130 131
131 // The implementation may destroy or steal the contents of the CompositorFrame 132 // The implementation may destroy or steal the contents of the CompositorFrame
132 // passed in (though it will not take ownership of the CompositorFrame 133 // passed in (though it will not take ownership of the CompositorFrame
133 // itself). For successful swaps, the implementation must call 134 // itself). For successful swaps, the implementation must call
134 // OutputSurfaceClient::DidSwapBuffersComplete() eventually. 135 // OutputSurfaceClient::DidSwapBuffersComplete() eventually.
135 virtual void SwapBuffers(CompositorFrame frame) = 0; 136 virtual void SwapBuffers(OutputSurfaceFrame frame) = 0;
136 137
137 // base::trace_event::MemoryDumpProvider implementation. 138 // base::trace_event::MemoryDumpProvider implementation.
138 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 139 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
139 base::trace_event::ProcessMemoryDump* pmd) override; 140 base::trace_event::ProcessMemoryDump* pmd) override;
140 141
141 protected: 142 protected:
142 void PostSwapBuffersComplete(); 143 void PostSwapBuffersComplete();
143 144
144 // Used internally for the context provider to inform the client about loss, 145 // 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. 146 // and can be overridden to change behaviour instead of informing the client.
(...skipping 16 matching lines...) Expand all
162 void OnSwapBuffersComplete(); 163 void OnSwapBuffersComplete();
163 164
164 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; 165 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
165 166
166 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 167 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
167 }; 168 };
168 169
169 } // namespace cc 170 } // namespace cc
170 171
171 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ 172 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698