| 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/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 // MojoPpapiGlobals::Delegate implementation. | 87 // MojoPpapiGlobals::Delegate implementation. |
| 88 virtual ScopedMessagePipeHandle CreateGLES2Context() override { | 88 virtual ScopedMessagePipeHandle CreateGLES2Context() override { |
| 89 CommandBufferPtr command_buffer; | 89 CommandBufferPtr command_buffer; |
| 90 SizePtr size = Size::New(); | 90 SizePtr size = Size::New(); |
| 91 size->width = 800; | 91 size->width = 800; |
| 92 size->width = 600; | 92 size->width = 600; |
| 93 // TODO(jamesr): Output a surface to the native viewport instead. | 93 // TODO(jamesr): Output a surface to the native viewport instead. |
| 94 gpu_service_->CreateOnscreenGLES2Context( | 94 gpu_service_->CreateOnscreenGLES2Context( |
| 95 native_viewport_id_, size.Pass(), Get(&command_buffer)); | 95 native_viewport_id_, size.Pass(), GetProxy(&command_buffer)); |
| 96 return command_buffer.PassMessagePipe(); | 96 return command_buffer.PassMessagePipe(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 void OnCreatedNativeViewport(uint64_t native_viewport_id) { | 100 void OnCreatedNativeViewport(uint64_t native_viewport_id) { |
| 101 native_viewport_id_ = native_viewport_id; | 101 native_viewport_id_ = native_viewport_id; |
| 102 ppapi::ProxyAutoLock lock; | 102 ppapi::ProxyAutoLock lock; |
| 103 | 103 |
| 104 plugin_instance_ = plugin_module_->CreateInstance().Pass(); | 104 plugin_instance_ = plugin_module_->CreateInstance().Pass(); |
| 105 if (!plugin_instance_->DidCreate()) | 105 if (!plugin_instance_->DidCreate()) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 121 | 121 |
| 122 } // namespace examples | 122 } // namespace examples |
| 123 } // namespace mojo | 123 } // namespace mojo |
| 124 | 124 |
| 125 MojoResult MojoMain(MojoHandle shell_handle) { | 125 MojoResult MojoMain(MojoHandle shell_handle) { |
| 126 mojo::ApplicationRunnerChromium runner( | 126 mojo::ApplicationRunnerChromium runner( |
| 127 new mojo::examples::PepperContainerApp); | 127 new mojo::examples::PepperContainerApp); |
| 128 return runner.Run(shell_handle); | 128 return runner.Run(shell_handle); |
| 129 } | 129 } |
| 130 | 130 |
| OLD | NEW |