OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SERVICES_GFX_COMPOSITOR_BACKEND_GPU_OUTPUT_H_ | 5 #ifndef SERVICES_GFX_COMPOSITOR_BACKEND_GPU_OUTPUT_H_ |
6 #define SERVICES_GFX_COMPOSITOR_BACKEND_GPU_OUTPUT_H_ | 6 #define SERVICES_GFX_COMPOSITOR_BACKEND_GPU_OUTPUT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <mutex> | 9 #include <mutex> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 DISALLOW_COPY_AND_ASSIGN(FrameQueue); | 55 DISALLOW_COPY_AND_ASSIGN(FrameQueue); |
56 }; | 56 }; |
57 | 57 |
58 // Wrapper around state which is only accessible by the rasterizer thread. | 58 // Wrapper around state which is only accessible by the rasterizer thread. |
59 class RasterizerDelegate { | 59 class RasterizerDelegate { |
60 public: | 60 public: |
61 explicit RasterizerDelegate(const std::shared_ptr<FrameQueue>& frame_queue); | 61 explicit RasterizerDelegate(const std::shared_ptr<FrameQueue>& frame_queue); |
62 ~RasterizerDelegate(); | 62 ~RasterizerDelegate(); |
63 | 63 |
64 void CreateRasterizer( | 64 void CreateRasterizer( |
65 mojo::InterfacePtrInfo<mojo::ContextProvider> context_provider_info, | 65 mojo::InterfaceHandle<mojo::ContextProvider> context_provider_info, |
66 const std::shared_ptr<VsyncScheduler>& scheduler, | 66 const std::shared_ptr<VsyncScheduler>& scheduler, |
67 const scoped_refptr<base::TaskRunner>& task_runner, | 67 const scoped_refptr<base::TaskRunner>& task_runner, |
68 const base::Closure& error_callback); | 68 const base::Closure& error_callback); |
69 | 69 |
70 void SubmitNextFrame(); | 70 void SubmitNextFrame(); |
71 | 71 |
72 private: | 72 private: |
73 std::shared_ptr<FrameQueue> frame_queue_; | 73 std::shared_ptr<FrameQueue> frame_queue_; |
74 std::unique_ptr<GpuRasterizer> rasterizer_; | 74 std::unique_ptr<GpuRasterizer> rasterizer_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(RasterizerDelegate); | 76 DISALLOW_COPY_AND_ASSIGN(RasterizerDelegate); |
77 }; | 77 }; |
78 | 78 |
79 std::shared_ptr<FrameQueue> frame_queue_; | 79 std::shared_ptr<FrameQueue> frame_queue_; |
80 std::shared_ptr<VsyncScheduler> scheduler_; | 80 std::shared_ptr<VsyncScheduler> scheduler_; |
81 scoped_ptr<RasterizerDelegate> rasterizer_delegate_; // can't use unique_ptr | 81 scoped_ptr<RasterizerDelegate> rasterizer_delegate_; // can't use unique_ptr |
82 // here due to | 82 // here due to |
83 // base::Bind (sadness) | 83 // base::Bind (sadness) |
84 std::unique_ptr<base::Thread> rasterizer_thread_; | 84 std::unique_ptr<base::Thread> rasterizer_thread_; |
85 scoped_refptr<base::SingleThreadTaskRunner> rasterizer_task_runner_; | 85 scoped_refptr<base::SingleThreadTaskRunner> rasterizer_task_runner_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(GpuOutput); | 87 DISALLOW_COPY_AND_ASSIGN(GpuOutput); |
88 }; | 88 }; |
89 | 89 |
90 } // namespace compositor | 90 } // namespace compositor |
91 | 91 |
92 #endif // SERVICES_GFX_COMPOSITOR_BACKEND_GPU_OUTPUT_H_ | 92 #endif // SERVICES_GFX_COMPOSITOR_BACKEND_GPU_OUTPUT_H_ |
OLD | NEW |