Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.cc

Issue 8865008: Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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()) { 214 if (command_buffer_->Initialize(kRingBufferSize)) {
215 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get())); 215 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(command_buffer_.get()));
216 if (gles2_helper_->Initialize(kRingBufferSize)) { 216 gpu::Buffer buffer = command_buffer_->GetRingBuffer();
217 DebugPrintf("PluginGraphics3D::InitFromBrowserResource: buffer size: %d\n",
218 buffer.size);
219 if (gles2_helper_->Initialize(buffer.size)) {
217 // Request id -1 to signify 'don't care' 220 // Request id -1 to signify 'don't care'
218 int32 transfer_buffer_id = 221 int32 transfer_buffer_id =
219 command_buffer_->CreateTransferBuffer(kTransferBufferSize, -1); 222 command_buffer_->CreateTransferBuffer(kTransferBufferSize, -1);
220 gpu::Buffer transfer_buffer = 223 gpu::Buffer transfer_buffer =
221 command_buffer_->GetTransferBuffer(transfer_buffer_id); 224 command_buffer_->GetTransferBuffer(transfer_buffer_id);
222 if (transfer_buffer.ptr) { 225 if (transfer_buffer.ptr) {
223 gles2_implementation_.reset(new gpu::gles2::GLES2Implementation( 226 gles2_implementation_.reset(new gpu::gles2::GLES2Implementation(
224 gles2_helper_.get(), 227 gles2_helper_.get(),
225 transfer_buffer.size, 228 transfer_buffer.size,
226 transfer_buffer.ptr, 229 transfer_buffer.ptr,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 &SetAttribs, 271 &SetAttribs,
269 &GetError, 272 &GetError,
270 &ResizeBuffers, 273 &ResizeBuffers,
271 &SwapBuffs, 274 &SwapBuffs,
272 }; 275 };
273 return &intf; 276 return &intf;
274 } 277 }
275 278
276 } // namespace ppapi_proxy 279 } // namespace ppapi_proxy
277 280
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698