| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "gpu/command_buffer/service/mailbox_manager_impl.h" | 7 #include "gpu/command_buffer/service/mailbox_manager_impl.h" |
| 8 #include "mojo/application/application_runner_chromium.h" | 8 #include "mojo/application/application_runner_chromium.h" |
| 9 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // InterfaceFactory<NativeViewport> implementation. | 55 // InterfaceFactory<NativeViewport> implementation. |
| 56 void Create(ApplicationConnection* connection, | 56 void Create(ApplicationConnection* connection, |
| 57 InterfaceRequest<NativeViewport> request) override { | 57 InterfaceRequest<NativeViewport> request) override { |
| 58 BindToRequest(new NativeViewportImpl(app_, is_headless_), &request); | 58 BindToRequest(new NativeViewportImpl(app_, is_headless_), &request); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // InterfaceFactory<Gpu> implementation. | 61 // InterfaceFactory<Gpu> implementation. |
| 62 void Create(ApplicationConnection* connection, | 62 void Create(ApplicationConnection* connection, |
| 63 InterfaceRequest<Gpu> request) override { | 63 InterfaceRequest<Gpu> request) override { |
| 64 BindToRequest(new GpuImpl(share_group_.get(), mailbox_manager_.get()), | 64 new GpuImpl(request.Pass(), share_group_.get(), mailbox_manager_.get()); |
| 65 &request); | |
| 66 } | 65 } |
| 67 | 66 |
| 68 ApplicationImpl* app_; | 67 ApplicationImpl* app_; |
| 69 scoped_refptr<gfx::GLShareGroup> share_group_; | 68 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 70 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 69 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 71 bool is_headless_; | 70 bool is_headless_; |
| 72 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); |
| 73 }; | 72 }; |
| 74 } | 73 } |
| 75 | 74 |
| 76 MojoResult MojoMain(MojoHandle shell_handle) { | 75 MojoResult MojoMain(MojoHandle shell_handle) { |
| 77 mojo::ApplicationRunnerChromium runner(new mojo::NativeViewportAppDelegate); | 76 mojo::ApplicationRunnerChromium runner(new mojo::NativeViewportAppDelegate); |
| 78 runner.set_message_loop_type(base::MessageLoop::TYPE_UI); | 77 runner.set_message_loop_type(base::MessageLoop::TYPE_UI); |
| 79 return runner.Run(shell_handle); | 78 return runner.Run(shell_handle); |
| 80 } | 79 } |
| OLD | NEW |