| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/demos/framework/window.h" | 5 #include "gpu/demos/framework/window.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "gpu/command_buffer/client/gles2_implementation.h" | 8 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 9 #include "gpu/command_buffer/client/gles2_lib.h" | 9 #include "gpu/command_buffer/client/gles2_lib.h" |
| 10 #include "gpu/command_buffer/service/command_buffer_service.h" | 10 #include "gpu/command_buffer/service/command_buffer_service.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // should fix that if we want to use this Window class for anything beyond this | 54 // should fix that if we want to use this Window class for anything beyond this |
| 55 // simple use case. | 55 // simple use case. |
| 56 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { | 56 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { |
| 57 scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); | 57 scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); |
| 58 if (!command_buffer->Initialize(kCommandBufferSize)) { | 58 if (!command_buffer->Initialize(kCommandBufferSize)) { |
| 59 return false; | 59 return false; |
| 60 } | 60 } |
| 61 | 61 |
| 62 GPUProcessor* gpu_processor( | 62 GPUProcessor* gpu_processor( |
| 63 new GPUProcessor(command_buffer.get(), NULL)); | 63 new GPUProcessor(command_buffer.get(), NULL)); |
| 64 if (!gpu_processor->Initialize(hwnd, gfx::Size(), NULL, std::vector<int32>(), | 64 if (!gpu_processor->Initialize(hwnd, gfx::Size(), |
| 65 gpu::gles2::DisallowedExtensions(), |
| 66 NULL, std::vector<int32>(), |
| 65 NULL, 0)) { | 67 NULL, 0)) { |
| 66 return false; | 68 return false; |
| 67 } | 69 } |
| 68 | 70 |
| 69 command_buffer->SetPutOffsetChangeCallback( | 71 command_buffer->SetPutOffsetChangeCallback( |
| 70 NewCallback(gpu_processor, &GPUProcessor::ProcessCommands)); | 72 NewCallback(gpu_processor, &GPUProcessor::ProcessCommands)); |
| 71 | 73 |
| 72 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); | 74 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); |
| 73 if (!helper->Initialize(kCommandBufferSize)) { | 75 if (!helper->Initialize(kCommandBufferSize)) { |
| 74 // TODO(alokp): cleanup. | 76 // TODO(alokp): cleanup. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 85 ::gles2::SetGLContext(new GLES2Implementation(helper, | 87 ::gles2::SetGLContext(new GLES2Implementation(helper, |
| 86 transfer_buffer.size, | 88 transfer_buffer.size, |
| 87 transfer_buffer.ptr, | 89 transfer_buffer.ptr, |
| 88 transfer_buffer_id, | 90 transfer_buffer_id, |
| 89 false)); | 91 false)); |
| 90 return command_buffer.release() != NULL; | 92 return command_buffer.release() != NULL; |
| 91 } | 93 } |
| 92 | 94 |
| 93 } // namespace demos | 95 } // namespace demos |
| 94 } // namespace gpu | 96 } // namespace gpu |
| OLD | NEW |