| 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 #include "services/gfx/compositor/backend/gpu_output.h" | 5 #include "services/gfx/compositor/backend/gpu_output.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 options.message_pump_factory = base::Bind(&CreateMessagePumpMojo); | 37 options.message_pump_factory = base::Bind(&CreateMessagePumpMojo); |
| 38 | 38 |
| 39 rasterizer_thread_.reset(new base::Thread("gpu_rasterizer")); | 39 rasterizer_thread_.reset(new base::Thread("gpu_rasterizer")); |
| 40 rasterizer_thread_->StartWithOptions(options); | 40 rasterizer_thread_->StartWithOptions(options); |
| 41 rasterizer_task_runner_ = rasterizer_thread_->message_loop()->task_runner(); | 41 rasterizer_task_runner_ = rasterizer_thread_->message_loop()->task_runner(); |
| 42 | 42 |
| 43 rasterizer_task_runner_->PostTask( | 43 rasterizer_task_runner_->PostTask( |
| 44 FROM_HERE, | 44 FROM_HERE, |
| 45 base::Bind(&RasterizerDelegate::CreateRasterizer, | 45 base::Bind(&RasterizerDelegate::CreateRasterizer, |
| 46 base::Unretained(rasterizer_delegate_.get()), | 46 base::Unretained(rasterizer_delegate_.get()), |
| 47 base::Passed(context_provider.PassInterface()), scheduler_, | 47 base::Passed(context_provider.PassInterfaceHandle()), |
| 48 base::MessageLoop::current()->task_runner(), error_callback)); | 48 scheduler_, base::MessageLoop::current()->task_runner(), |
| 49 error_callback)); |
| 49 } | 50 } |
| 50 | 51 |
| 51 GpuOutput::~GpuOutput() { | 52 GpuOutput::~GpuOutput() { |
| 52 // Ensure destruction happens on the correct thread. | 53 // Ensure destruction happens on the correct thread. |
| 53 rasterizer_task_runner_->PostTask( | 54 rasterizer_task_runner_->PostTask( |
| 54 FROM_HERE, base::Bind(&Drop<RasterizerDelegate>, | 55 FROM_HERE, base::Bind(&Drop<RasterizerDelegate>, |
| 55 base::Passed(&rasterizer_delegate_))); | 56 base::Passed(&rasterizer_delegate_))); |
| 56 } | 57 } |
| 57 | 58 |
| 58 Scheduler* GpuOutput::GetScheduler() { | 59 Scheduler* GpuOutput::GetScheduler() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 scheduler, task_runner, error_callback)); | 103 scheduler, task_runner, error_callback)); |
| 103 } | 104 } |
| 104 | 105 |
| 105 void GpuOutput::RasterizerDelegate::SubmitNextFrame() { | 106 void GpuOutput::RasterizerDelegate::SubmitNextFrame() { |
| 106 std::shared_ptr<RenderFrame> frame(frame_queue_->TakeFrame()); | 107 std::shared_ptr<RenderFrame> frame(frame_queue_->TakeFrame()); |
| 107 DCHECK(frame); | 108 DCHECK(frame); |
| 108 rasterizer_->SubmitFrame(frame); | 109 rasterizer_->SubmitFrame(frame); |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace compositor | 112 } // namespace compositor |
| OLD | NEW |