OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gles2_conform_support/egl/display.h" | 5 #include "gpu/gles2_conform_support/egl/display.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 gpu::TransferBufferManager* manager = new gpu::TransferBufferManager(); | 106 gpu::TransferBufferManager* manager = new gpu::TransferBufferManager(); |
107 transfer_buffer_manager_.reset(manager); | 107 transfer_buffer_manager_.reset(manager); |
108 manager->Initialize(); | 108 manager->Initialize(); |
109 } | 109 } |
110 scoped_ptr<gpu::CommandBufferService> command_buffer( | 110 scoped_ptr<gpu::CommandBufferService> command_buffer( |
111 new gpu::CommandBufferService(transfer_buffer_manager_.get())); | 111 new gpu::CommandBufferService(transfer_buffer_manager_.get())); |
112 if (!command_buffer->Initialize()) | 112 if (!command_buffer->Initialize()) |
113 return NULL; | 113 return NULL; |
114 | 114 |
115 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( | 115 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( |
116 NULL, NULL, NULL, new gpu::gles2::ShaderTranslatorCache, NULL, true)); | 116 NULL, NULL, new gpu::gles2::ShaderTranslatorCache, NULL, true)); |
117 | 117 |
118 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); | 118 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); |
119 if (!decoder_.get()) | 119 if (!decoder_.get()) |
120 return EGL_NO_SURFACE; | 120 return EGL_NO_SURFACE; |
121 | 121 |
122 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer.get(), | 122 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer.get(), |
123 decoder_.get(), | 123 decoder_.get(), |
124 NULL)); | 124 NULL)); |
125 | 125 |
126 decoder_->set_engine(gpu_scheduler_.get()); | 126 decoder_->set_engine(gpu_scheduler_.get()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 if (!decoder_->Initialize(gl_surface_.get(), | 163 if (!decoder_->Initialize(gl_surface_.get(), |
164 gl_context_.get(), | 164 gl_context_.get(), |
165 gl_surface_->IsOffscreen(), | 165 gl_surface_->IsOffscreen(), |
166 size, | 166 size, |
167 gpu::gles2::DisallowedFeatures(), | 167 gpu::gles2::DisallowedFeatures(), |
168 attribs)) { | 168 attribs)) { |
169 return EGL_NO_SURFACE; | 169 return EGL_NO_SURFACE; |
170 } | 170 } |
171 | 171 |
172 gpu_control_service_.reset(new gpu::GpuControlService(NULL, NULL)); | |
173 | |
174 command_buffer->SetPutOffsetChangeCallback( | 172 command_buffer->SetPutOffsetChangeCallback( |
175 base::Bind(&gpu::GpuScheduler::PutChanged, | 173 base::Bind(&gpu::GpuScheduler::PutChanged, |
176 base::Unretained(gpu_scheduler_.get()))); | 174 base::Unretained(gpu_scheduler_.get()))); |
177 command_buffer->SetGetBufferChangeCallback( | 175 command_buffer->SetGetBufferChangeCallback( |
178 base::Bind(&gpu::GpuScheduler::SetGetBuffer, | 176 base::Bind(&gpu::GpuScheduler::SetGetBuffer, |
179 base::Unretained(gpu_scheduler_.get()))); | 177 base::Unretained(gpu_scheduler_.get()))); |
180 | 178 |
181 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( | 179 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( |
182 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); | 180 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); |
183 if (!cmd_helper->Initialize(kCommandBufferSize)) | 181 if (!cmd_helper->Initialize(kCommandBufferSize)) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 void Display::Echo(const base::Closure& callback) { | 315 void Display::Echo(const base::Closure& callback) { |
318 NOTIMPLEMENTED(); | 316 NOTIMPLEMENTED(); |
319 } | 317 } |
320 | 318 |
321 uint32 Display::CreateStreamTexture(uint32 texture_id) { | 319 uint32 Display::CreateStreamTexture(uint32 texture_id) { |
322 NOTIMPLEMENTED(); | 320 NOTIMPLEMENTED(); |
323 return 0; | 321 return 0; |
324 } | 322 } |
325 | 323 |
326 } // namespace egl | 324 } // namespace egl |
OLD | NEW |