OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "cc/output/compositor_frame_sink_client.h" | 12 #include "cc/output/compositor_frame_sink_client.h" |
13 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" | 13 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
14 #include "gpu/command_buffer/common/mailbox.h" | 14 #include "gpu/command_buffer/common/mailbox.h" |
15 #include "gpu/ipc/common/surface_handle.h" | 15 #include "gpu/ipc/common/surface_handle.h" |
16 | 16 |
| 17 namespace gpu { |
| 18 class GpuMemoryBufferManager; |
| 19 } |
| 20 |
17 namespace ui { | 21 namespace ui { |
18 class Window; | 22 class Window; |
19 class WindowCompositorFrameSink; | 23 class WindowCompositorFrameSink; |
20 } | 24 } |
21 | 25 |
22 namespace content { | 26 namespace content { |
23 | 27 |
24 // Adapts a WebGraphicsContext3DCommandBufferImpl into a | 28 // Adapts a WebGraphicsContext3DCommandBufferImpl into a |
25 // cc::OutputSurface that also handles vsync parameter updates | 29 // cc::OutputSurface that also handles vsync parameter updates |
26 // arriving from the GPU process. | 30 // arriving from the GPU process. |
27 class MusBrowserCompositorOutputSurface | 31 class MusBrowserCompositorOutputSurface |
28 : public GpuBrowserCompositorOutputSurface, | 32 : public GpuBrowserCompositorOutputSurface, |
29 public cc::CompositorFrameSinkClient { | 33 public cc::CompositorFrameSinkClient { |
30 public: | 34 public: |
31 MusBrowserCompositorOutputSurface( | 35 MusBrowserCompositorOutputSurface( |
32 ui::Window* window, | 36 ui::Window* window, |
33 scoped_refptr<ContextProviderCommandBuffer> context, | 37 scoped_refptr<ContextProviderCommandBuffer> context, |
| 38 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
34 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 39 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, |
35 cc::SyntheticBeginFrameSource* begin_frame_source, | 40 cc::SyntheticBeginFrameSource* begin_frame_source, |
36 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 41 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
37 overlay_candidate_validator); | 42 overlay_candidate_validator); |
38 | 43 |
39 ~MusBrowserCompositorOutputSurface() override; | 44 ~MusBrowserCompositorOutputSurface() override; |
40 | 45 |
41 protected: | 46 protected: |
42 // cc::OutputSurface implementation. | 47 // cc::OutputSurface implementation. |
43 void SwapBuffers(cc::OutputSurfaceFrame frame) override; | 48 void SwapBuffers(cc::OutputSurfaceFrame frame) override; |
(...skipping 21 matching lines...) Expand all Loading... |
65 std::unique_ptr<ui::WindowCompositorFrameSink> ui_compositor_frame_sink_; | 70 std::unique_ptr<ui::WindowCompositorFrameSink> ui_compositor_frame_sink_; |
66 std::vector<uint32_t> free_resource_ids_; | 71 std::vector<uint32_t> free_resource_ids_; |
67 std::vector<gpu::Mailbox> mailboxes_; | 72 std::vector<gpu::Mailbox> mailboxes_; |
68 | 73 |
69 DISALLOW_COPY_AND_ASSIGN(MusBrowserCompositorOutputSurface); | 74 DISALLOW_COPY_AND_ASSIGN(MusBrowserCompositorOutputSurface); |
70 }; | 75 }; |
71 | 76 |
72 } // namespace content | 77 } // namespace content |
73 | 78 |
74 #endif // CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 79 #endif // CONTENT_BROWSER_COMPOSITOR_MUS_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |