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/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" | 10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 callback.Run(); | 88 callback.Run(); |
89 } | 89 } |
90 | 90 |
91 // MojoPpapiGlobals::Delegate implementation. | 91 // MojoPpapiGlobals::Delegate implementation. |
92 virtual ScopedMessagePipeHandle CreateGLES2Context() OVERRIDE { | 92 virtual ScopedMessagePipeHandle CreateGLES2Context() OVERRIDE { |
93 CommandBufferPtr command_buffer; | 93 CommandBufferPtr command_buffer; |
94 SizePtr size = Size::New(); | 94 SizePtr size = Size::New(); |
95 size->width = 800; | 95 size->width = 800; |
96 size->width = 600; | 96 size->width = 600; |
| 97 // TODO(jamesr): Output a surface to the native viewport instead. |
97 gpu_service_->CreateOnscreenGLES2Context( | 98 gpu_service_->CreateOnscreenGLES2Context( |
98 native_viewport_id_, size.Pass(), Get(&command_buffer)); | 99 native_viewport_id_, size.Pass(), Get(&command_buffer)); |
99 return command_buffer.PassMessagePipe(); | 100 return command_buffer.PassMessagePipe(); |
100 } | 101 } |
101 | 102 |
102 private: | 103 private: |
103 MojoPpapiGlobals ppapi_globals_; | 104 MojoPpapiGlobals ppapi_globals_; |
104 | 105 |
105 uint64_t native_viewport_id_; | 106 uint64_t native_viewport_id_; |
106 NativeViewportPtr viewport_; | 107 NativeViewportPtr viewport_; |
107 GpuPtr gpu_service_; | 108 GpuPtr gpu_service_; |
108 scoped_refptr<PluginModule> plugin_module_; | 109 scoped_refptr<PluginModule> plugin_module_; |
109 scoped_ptr<PluginInstance> plugin_instance_; | 110 scoped_ptr<PluginInstance> plugin_instance_; |
110 | 111 |
111 DISALLOW_COPY_AND_ASSIGN(PepperContainerApp); | 112 DISALLOW_COPY_AND_ASSIGN(PepperContainerApp); |
112 }; | 113 }; |
113 | 114 |
114 } // namespace examples | 115 } // namespace examples |
115 } // namespace mojo | 116 } // namespace mojo |
116 | 117 |
117 MojoResult MojoMain(MojoHandle shell_handle) { | 118 MojoResult MojoMain(MojoHandle shell_handle) { |
118 mojo::ApplicationRunnerChromium runner( | 119 mojo::ApplicationRunnerChromium runner( |
119 new mojo::examples::PepperContainerApp); | 120 new mojo::examples::PepperContainerApp); |
120 return runner.Run(shell_handle); | 121 return runner.Run(shell_handle); |
121 } | 122 } |
122 | 123 |
OLD | NEW |