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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 new GpuScheduler(command_buffer.get(), NULL, NULL)); |
64 if (!gpu_scheduler->Initialize(hwnd, gfx::Size(), | 64 if (!gpu_scheduler->Initialize(hwnd, gfx::Size(), |
65 gpu::gles2::DisallowedExtensions(), | 65 gpu::gles2::DisallowedExtensions(), |
66 NULL, std::vector<int32>(), | 66 NULL, std::vector<int32>(), |
67 NULL, | |
68 0, | |
69 NULL)) { | 67 NULL)) { |
70 return false; | 68 return false; |
71 } | 69 } |
72 | 70 |
73 command_buffer->SetPutOffsetChangeCallback( | 71 command_buffer->SetPutOffsetChangeCallback( |
74 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); | 72 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); |
75 | 73 |
76 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); | 74 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); |
77 if (!helper->Initialize(kCommandBufferSize)) { | 75 if (!helper->Initialize(kCommandBufferSize)) { |
78 // TODO(alokp): cleanup. | 76 // TODO(alokp): cleanup. |
(...skipping 10 matching lines...) Expand all Loading... |
89 ::gles2::SetGLContext(new GLES2Implementation(helper, | 87 ::gles2::SetGLContext(new GLES2Implementation(helper, |
90 transfer_buffer.size, | 88 transfer_buffer.size, |
91 transfer_buffer.ptr, | 89 transfer_buffer.ptr, |
92 transfer_buffer_id, | 90 transfer_buffer_id, |
93 false)); | 91 false)); |
94 return command_buffer.release() != NULL; | 92 return command_buffer.release() != NULL; |
95 } | 93 } |
96 | 94 |
97 } // namespace demos | 95 } // namespace demos |
98 } // namespace gpu | 96 } // namespace gpu |
OLD | NEW |