Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: mojo/examples/pepper_container_app/pepper_container_app.cc

Issue 510553002: Teach the native viewport service to draw a Surface into itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/examples/compositor_app/compositor_app.cc ('k') | mojo/examples/sample_app/sample_app.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « mojo/examples/compositor_app/compositor_app.cc ('k') | mojo/examples/sample_app/sample_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698