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 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "mojo/services/gpu/interfaces/context_provider.mojom.h" | 17 #include "mojo/services/gpu/interfaces/context_provider.mojom.h" |
18 #include "services/gfx/compositor/backend/output.h" | 18 #include "services/gfx/compositor/backend/output.h" |
19 #include "services/gfx/compositor/backend/vsync_scheduler.h" | 19 #include "services/gfx/compositor/backend/vsync_scheduler.h" |
20 | 20 |
21 namespace compositor { | 21 namespace compositor { |
22 | 22 |
23 class GpuRasterizer; | 23 class GpuRasterizer; |
24 | 24 |
25 // Renderer backed by a ContextProvider. | 25 // Renderer backed by a ContextProvider. |
26 class GpuOutput : public Output { | 26 class GpuOutput : public Output { |
27 public: | 27 public: |
28 GpuOutput(mojo::ContextProviderPtr context_provider, | 28 GpuOutput(mojo::InterfaceHandle<mojo::ContextProvider> context_provider, |
29 const SchedulerCallbacks& scheduler_callbacks, | 29 const SchedulerCallbacks& scheduler_callbacks, |
30 const base::Closure& error_callback); | 30 const base::Closure& error_callback); |
31 ~GpuOutput() override; | 31 ~GpuOutput() override; |
32 | 32 |
33 Scheduler* GetScheduler() override; | 33 Scheduler* GetScheduler() override; |
34 void SubmitFrame(const std::shared_ptr<RenderFrame>& frame) override; | 34 void SubmitFrame(const std::shared_ptr<RenderFrame>& frame) override; |
35 | 35 |
36 private: | 36 private: |
37 // Frame queue, held by a std::shared_ptr. | 37 // Frame queue, held by a std::shared_ptr. |
38 // This object acts as a shared fifo between both threads. | 38 // This object acts as a shared fifo between both threads. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |