OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // TODO(apatrick): It looks like all the resources allocated here leak. We | 53 // TODO(apatrick): It looks like all the resources allocated here leak. We |
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 GpuScheduler* gpu_scheduler( | 62 GpuScheduler* gpu_scheduler( |
63 new GpuScheduler(command_buffer.get(), NULL, NULL)); | 63 GpuScheduler::Create(command_buffer.get(), |
| 64 NULL, |
| 65 NULL)); |
64 if (!gpu_scheduler->Initialize(hwnd, gfx::Size(), | 66 if (!gpu_scheduler->Initialize(hwnd, gfx::Size(), |
65 gpu::gles2::DisallowedExtensions(), | 67 gpu::gles2::DisallowedExtensions(), |
66 NULL, std::vector<int32>(), | 68 NULL, std::vector<int32>(), |
67 NULL)) { | 69 NULL)) { |
68 return false; | 70 return false; |
69 } | 71 } |
70 | 72 |
71 command_buffer->SetPutOffsetChangeCallback( | 73 command_buffer->SetPutOffsetChangeCallback( |
72 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); | 74 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); |
73 | 75 |
(...skipping 13 matching lines...) Expand all Loading... |
87 ::gles2::SetGLContext(new GLES2Implementation(helper, | 89 ::gles2::SetGLContext(new GLES2Implementation(helper, |
88 transfer_buffer.size, | 90 transfer_buffer.size, |
89 transfer_buffer.ptr, | 91 transfer_buffer.ptr, |
90 transfer_buffer_id, | 92 transfer_buffer_id, |
91 false)); | 93 false)); |
92 return command_buffer.release() != NULL; | 94 return command_buffer.release() != NULL; |
93 } | 95 } |
94 | 96 |
95 } // namespace demos | 97 } // namespace demos |
96 } // namespace gpu | 98 } // namespace gpu |
OLD | NEW |