diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:08:35 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:08:35 +0000 |
commit | 6217d397bf501ec1ec5b7270d493006badd4d87a (patch) | |
tree | fce6c8e9c15b79bab29a9535ce9929dd9d53735b /gpu/demos/framework | |
parent | 21dedcc12d21ccb288244249522d77bc074c501e (diff) | |
download | chromium_src-6217d397bf501ec1ec5b7270d493006badd4d87a.zip chromium_src-6217d397bf501ec1ec5b7270d493006badd4d87a.tar.gz chromium_src-6217d397bf501ec1ec5b7270d493006badd4d87a.tar.bz2 |
Calling OpenGL from the renderer process
- Added ability for renderer processes to render to a real window (Windows only so far).
- Added ability to create offscreen frame buffer objects that can be resized later.
- OpenGL context can have a "parent" context that can access its last swapped back buffer through a texture ID.
- Moved code to establish GPU channel from RenderWidget to RenderThread.
- Changed way service size command buffer object lifetimes are managed.
TEST=trybot and visual verification that OpenGL can clear the browser window to magenta.
BUG=none
Review URL: http://codereview.chromium.org/1136006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/demos/framework')
-rw-r--r-- | gpu/demos/framework/window.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc index 600514f..0a9db79 100644 --- a/gpu/demos/framework/window.cc +++ b/gpu/demos/framework/window.cc @@ -50,20 +50,23 @@ void Window::OnPaint() { ::gles2::GetGLContext()->SwapBuffers(); } +// TODO(apatrick): It looks like all the resources allocated here leak. We +// should fix that if we want to use this Window class for anything beyond this +// simple use case. bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); if (!command_buffer->Initialize(kCommandBufferSize)) { return false; } - scoped_refptr<GPUProcessor> gpu_processor( + GPUProcessor* gpu_processor( new GPUProcessor(command_buffer.get())); - if (!gpu_processor->Initialize(hwnd)) { + if (!gpu_processor->Initialize(hwnd, NULL, gfx::Size(), 0)) { return false; } command_buffer->SetPutOffsetChangeCallback( - NewCallback(gpu_processor.get(), &GPUProcessor::ProcessCommands)); + NewCallback(gpu_processor, &GPUProcessor::ProcessCommands)); GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); if (!helper->Initialize()) { |