| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return impl; | 204 return impl; |
| 205 } | 205 } |
| 206 | 206 |
| 207 | 207 |
| 208 bool PluginGraphics3D::InitFromBrowserResource(PP_Resource res) { | 208 bool PluginGraphics3D::InitFromBrowserResource(PP_Resource res) { |
| 209 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: " | 209 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: " |
| 210 "resource=%"NACL_PRIu32"\n", res); | 210 "resource=%"NACL_PRIu32"\n", res); |
| 211 | 211 |
| 212 // Create and initialize the objects required to issue GLES2 calls. | 212 // Create and initialize the objects required to issue GLES2 calls. |
| 213 command_buffer_.reset(new CommandBufferNacl(res, PluginCore::GetInterface())); | 213 command_buffer_.reset(new CommandBufferNacl(res, PluginCore::GetInterface())); |
| 214 if (command_buffer_->Initialize(kRingBufferSize)) { | 214 if (command_buffer_->Initialize()) { |
| 215 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get())); | 215 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get())); |
| 216 gpu::Buffer buffer = command_buffer_->GetRingBuffer(); | 216 if (gles2_helper_->Initialize(kRingBufferSize)) { |
| 217 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: buffer size: %d\n", | |
| 218 buffer.size); | |
| 219 if (gles2_helper_->Initialize(buffer.size)) { | |
| 220 // Request id -1 to signify 'don't care' | 217 // Request id -1 to signify 'don't care' |
| 221 int32 transfer_buffer_id = | 218 int32 transfer_buffer_id = |
| 222 command_buffer_->CreateTransferBuffer(kTransferBufferSize, -1); | 219 command_buffer_->CreateTransferBuffer(kTransferBufferSize, -1); |
| 223 gpu::Buffer transfer_buffer = | 220 gpu::Buffer transfer_buffer = |
| 224 command_buffer_->GetTransferBuffer(transfer_buffer_id); | 221 command_buffer_->GetTransferBuffer(transfer_buffer_id); |
| 225 if (transfer_buffer.ptr) { | 222 if (transfer_buffer.ptr) { |
| 226 gles2_implementation_.reset(new gpu::gles2::GLES2Implementation( | 223 gles2_implementation_.reset(new gpu::gles2::GLES2Implementation( |
| 227 gles2_helper_.get(), | 224 gles2_helper_.get(), |
| 228 transfer_buffer.size, | 225 transfer_buffer.size, |
| 229 transfer_buffer.ptr, | 226 transfer_buffer.ptr, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 &SetAttribs, | 268 &SetAttribs, |
| 272 &GetError, | 269 &GetError, |
| 273 &ResizeBuffers, | 270 &ResizeBuffers, |
| 274 &SwapBuffs, | 271 &SwapBuffs, |
| 275 }; | 272 }; |
| 276 return &intf; | 273 return &intf; |
| 277 } | 274 } |
| 278 | 275 |
| 279 } // namespace ppapi_proxy | 276 } // namespace ppapi_proxy |
| 280 | 277 |
| OLD | NEW |