OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h" | 7 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h" |
8 | 8 |
9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
10 #include "native_client/src/shared/ppapi_proxy/command_buffer_nacl.h" | 10 #include "native_client/src/shared/ppapi_proxy/command_buffer_nacl.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return impl; | 205 return impl; |
206 } | 206 } |
207 | 207 |
208 | 208 |
209 bool PluginGraphics3D::InitFromBrowserResource(PP_Resource res) { | 209 bool PluginGraphics3D::InitFromBrowserResource(PP_Resource res) { |
210 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: " | 210 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: " |
211 "resource=%"NACL_PRIu32"\n", res); | 211 "resource=%"NACL_PRIu32"\n", res); |
212 | 212 |
213 // Create and initialize the objects required to issue GLES2 calls. | 213 // Create and initialize the objects required to issue GLES2 calls. |
214 command_buffer_.reset(new CommandBufferNacl(res, PluginCore::GetInterface())); | 214 command_buffer_.reset(new CommandBufferNacl(res, PluginCore::GetInterface())); |
215 if (command_buffer_->Initialize()) { | 215 if (command_buffer_->Initialize(kRingBufferSize)) { |
216 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get())); | 216 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get())); |
217 if (gles2_helper_->Initialize(kRingBufferSize)) { | 217 gpu::Buffer buffer = command_buffer_->GetRingBuffer(); |
| 218 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: buffer size: %d\n", |
| 219 buffer.size); |
| 220 if (gles2_helper_->Initialize(buffer.size)) { |
218 // Request id -1 to signify 'don't care' | 221 // Request id -1 to signify 'don't care' |
219 int32 transfer_buffer_id = | 222 int32 transfer_buffer_id = |
220 command_buffer_->CreateTransferBuffer(kTransferBufferSize, -1); | 223 command_buffer_->CreateTransferBuffer(kTransferBufferSize, -1); |
221 gpu::Buffer transfer_buffer = | 224 gpu::Buffer transfer_buffer = |
222 command_buffer_->GetTransferBuffer(transfer_buffer_id); | 225 command_buffer_->GetTransferBuffer(transfer_buffer_id); |
223 if (transfer_buffer.ptr) { | 226 if (transfer_buffer.ptr) { |
224 gles2_implementation_.reset(new gpu::gles2::GLES2Implementation( | 227 gles2_implementation_.reset(new gpu::gles2::GLES2Implementation( |
225 gles2_helper_.get(), | 228 gles2_helper_.get(), |
226 transfer_buffer.size, | 229 transfer_buffer.size, |
227 transfer_buffer.ptr, | 230 transfer_buffer.ptr, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 &SetAttribs, | 272 &SetAttribs, |
270 &GetError, | 273 &GetError, |
271 &ResizeBuffers, | 274 &ResizeBuffers, |
272 &SwapBuffs, | 275 &SwapBuffs, |
273 }; | 276 }; |
274 return &intf; | 277 return &intf; |
275 } | 278 } |
276 | 279 |
277 } // namespace ppapi_proxy | 280 } // namespace ppapi_proxy |
278 | 281 |
OLD | NEW |